diff --git a/DEPS b/DEPS index f3d1dc8..ea70baa 100644 --- a/DEPS +++ b/DEPS
@@ -40,7 +40,7 @@ # 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': '7c61dc9a08f09eb2a07970e7f9d2ddee079753d7', + 'skia_revision': '9018952290a468886c819405c6d9495b4aa5d7d4', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other.
diff --git a/base/test/gtest_xml_unittest_result_printer.cc b/base/test/gtest_xml_unittest_result_printer.cc index 31ac4ad..81a3d9fb 100644 --- a/base/test/gtest_xml_unittest_result_printer.cc +++ b/base/test/gtest_xml_unittest_result_printer.cc
@@ -5,14 +5,23 @@ #include "base/test/gtest_xml_unittest_result_printer.h" #include "base/base64.h" +#include "base/command_line.h" #include "base/files/file_util.h" #include "base/logging.h" +#include "base/test/test_switches.h" #include "base/time/time.h" namespace base { -XmlUnitTestResultPrinter::XmlUnitTestResultPrinter() : output_file_(NULL) { -} +namespace { +const int kDefaultTestPartResultsLimit = 10; + +const char kTestPartLesultsLimitExceeded[] = + "Test part results limit exceeded. Use --test-launcher-test-part-limit to " + "increase or disable limit."; +} // namespace + +XmlUnitTestResultPrinter::XmlUnitTestResultPrinter() : output_file_(NULL) {} XmlUnitTestResultPrinter::~XmlUnitTestResultPrinter() { if (output_file_) { @@ -73,12 +82,33 @@ fprintf(output_file_, " <failure message=\"\" type=\"\"></failure>\n"); } - for (int i = 0; i < test_info.result()->total_part_count(); ++i) { + + int limit = test_info.result()->total_part_count(); + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kTestLauncherTestPartResultsLimit)) { + std::string limit_str = + CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + switches::kTestLauncherTestPartResultsLimit); + int test_part_results_limit = std::strtol(limit_str.c_str(), nullptr, 10); + if (test_part_results_limit >= 0) + limit = std::min(limit, test_part_results_limit); + } else { + limit = std::min(limit, kDefaultTestPartResultsLimit); + } + + for (int i = 0; i < limit; ++i) { const auto& test_part_result = test_info.result()->GetTestPartResult(i); WriteTestPartResult(test_part_result.file_name(), test_part_result.line_number(), test_part_result.type(), test_part_result.summary(), test_part_result.message()); } + + if (test_info.result()->total_part_count() > limit) { + WriteTestPartResult( + "<unknown>", 0, testing::TestPartResult::kNonFatalFailure, + kTestPartLesultsLimitExceeded, kTestPartLesultsLimitExceeded); + } + fprintf(output_file_, " </testcase>\n"); fflush(output_file_); }
diff --git a/base/test/launcher/unit_test_launcher.cc b/base/test/launcher/unit_test_launcher.cc index 44c440f..65531a2 100644 --- a/base/test/launcher/unit_test_launcher.cc +++ b/base/test/launcher/unit_test_launcher.cc
@@ -92,6 +92,11 @@ " Controls when full test output is printed.\n" " auto means to print it when the test failed.\n" "\n" + " --test-launcher-test-part-results-limit=N\n" + " Sets the limit of failed EXPECT/ASSERT entries in the xml and\n" + " JSON outputs per test to N (default N=10). Negative value \n" + " will disable this limit.\n" + "\n" " --test-launcher-total-shards=N\n" " Sets the total number of shards to N.\n" "\n"
diff --git a/base/test/test_switches.cc b/base/test/test_switches.cc index 817a38e..48f6861 100644 --- a/base/test/test_switches.cc +++ b/base/test/test_switches.cc
@@ -56,6 +56,11 @@ const char switches::kTestLauncherShardIndex[] = "test-launcher-shard-index"; +// Limit of test part results in the output. Default limit is 10. +// Negative value will completely disable limit. +const char switches::kTestLauncherTestPartResultsLimit[] = + "test-launcher-test-part-results-limit"; + // Total number of shards. Must be the same for all shards. const char switches::kTestLauncherTotalShards[] = "test-launcher-total-shards";
diff --git a/base/test/test_switches.h b/base/test/test_switches.h index 88ef0ced..580aafdf 100644 --- a/base/test/test_switches.h +++ b/base/test/test_switches.h
@@ -22,6 +22,7 @@ extern const char kTestLauncherPrintTestStdio[]; extern const char kTestLauncherPrintWritablePath[]; extern const char kTestLauncherShardIndex[]; +extern const char kTestLauncherTestPartResultsLimit[]; extern const char kTestLauncherTotalShards[]; extern const char kTestLauncherTimeout[]; extern const char kTestLauncherTrace[];
diff --git a/base/threading/sequenced_task_runner_handle_unittest.cc b/base/threading/sequenced_task_runner_handle_unittest.cc index 6f4948a3..544dc10 100644 --- a/base/threading/sequenced_task_runner_handle_unittest.cc +++ b/base/threading/sequenced_task_runner_handle_unittest.cc
@@ -10,15 +10,13 @@ #include "base/callback.h" #include "base/location.h" #include "base/memory/ref_counted.h" -#include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/sequence_checker_impl.h" #include "base/sequenced_task_runner.h" #include "base/synchronization/waitable_event.h" -#include "base/test/sequenced_worker_pool_owner.h" +#include "base/task_scheduler/post_task.h" +#include "base/test/scoped_task_environment.h" #include "base/test/test_simple_task_runner.h" -#include "base/threading/sequenced_worker_pool.h" -#include "base/threading/simple_thread.h" #include "base/threading/thread_task_runner_handle.h" #include "testing/gtest/include/gtest/gtest.h" @@ -29,8 +27,8 @@ protected: // Verifies that the context it runs on has a SequencedTaskRunnerHandle // and that posting to it results in the posted task running in that same - // context (sequence). Runs |callback| on sequence when done. - static void VerifyCurrentSequencedTaskRunner(const Closure& callback) { + // context (sequence). + static void VerifyCurrentSequencedTaskRunner() { ASSERT_TRUE(SequencedTaskRunnerHandle::IsSet()); scoped_refptr<SequencedTaskRunner> task_runner = SequencedTaskRunnerHandle::Get(); @@ -42,59 +40,35 @@ task_runner->PostTask( FROM_HERE, base::BindOnce(&SequencedTaskRunnerHandleTest::CheckValidSequence, - base::Passed(&sequence_checker), callback)); + base::Passed(&sequence_checker))); } - // Verifies that there is no SequencedTaskRunnerHandle in the context it runs. - // Runs |callback| when done. - static void VerifyNoSequencedTaskRunner(const Closure& callback) { - ASSERT_FALSE(SequencedTaskRunnerHandle::IsSet()); - callback.Run(); - } - - private: static void CheckValidSequence( - std::unique_ptr<SequenceCheckerImpl> sequence_checker, - const Closure& callback) { + std::unique_ptr<SequenceCheckerImpl> sequence_checker) { EXPECT_TRUE(sequence_checker->CalledOnValidSequence()); - callback.Run(); } - MessageLoop message_loop_; + base::test::ScopedTaskEnvironment scoped_task_environment_; }; TEST_F(SequencedTaskRunnerHandleTest, FromMessageLoop) { - RunLoop run_loop; - VerifyCurrentSequencedTaskRunner(run_loop.QuitClosure()); - run_loop.Run(); + VerifyCurrentSequencedTaskRunner(); + RunLoop().RunUntilIdle(); } -TEST_F(SequencedTaskRunnerHandleTest, FromSequencedWorkerPoolTask) { - // Wrap the SequencedWorkerPool to avoid leaks due to its asynchronous - // destruction. - SequencedWorkerPoolOwner owner(3, "Test"); - WaitableEvent event(WaitableEvent::ResetPolicy::AUTOMATIC, - WaitableEvent::InitialState::NOT_SIGNALED); - owner.pool()->PostSequencedWorkerTask( - owner.pool()->GetSequenceToken(), FROM_HERE, +TEST_F(SequencedTaskRunnerHandleTest, FromTaskSchedulerSequencedTask) { + base::CreateSequencedTaskRunnerWithTraits({})->PostTask( + FROM_HERE, base::BindOnce( - &SequencedTaskRunnerHandleTest::VerifyCurrentSequencedTaskRunner, - base::Bind(&WaitableEvent::Signal, base::Unretained(&event)))); - event.Wait(); + &SequencedTaskRunnerHandleTest::VerifyCurrentSequencedTaskRunner)); + scoped_task_environment_.RunUntilIdle(); } TEST_F(SequencedTaskRunnerHandleTest, NoHandleFromUnsequencedTask) { - // Wrap the SequencedWorkerPool to avoid leaks due to its asynchronous - // destruction. - SequencedWorkerPoolOwner owner(3, "Test"); - WaitableEvent event(WaitableEvent::ResetPolicy::AUTOMATIC, - WaitableEvent::InitialState::NOT_SIGNALED); - owner.pool()->PostWorkerTask( - FROM_HERE, - base::BindOnce( - &SequencedTaskRunnerHandleTest::VerifyNoSequencedTaskRunner, - base::Bind(&WaitableEvent::Signal, base::Unretained(&event)))); - event.Wait(); + base::PostTask(FROM_HERE, base::BindOnce([]() { + EXPECT_FALSE(SequencedTaskRunnerHandle::IsSet()); + })); + scoped_task_environment_.RunUntilIdle(); } TEST(SequencedTaskRunnerHandleTestWithoutMessageLoop, FromHandleInScope) {
diff --git a/base/trace_event/memory_dump_manager.cc b/base/trace_event/memory_dump_manager.cc index 32c93f7..3df7503 100644 --- a/base/trace_event/memory_dump_manager.cc +++ b/base/trace_event/memory_dump_manager.cc
@@ -320,10 +320,18 @@ if (dumper_registrations_ignored_for_testing_) return; + // A handful of MDPs are required to compute the summary struct these are + // 'whitelisted for summary mode'. These MDPs are a subset of those which + // have small enough performance overhead that it is resonable to run them + // in the background while the user is doing other things. Those MDPs are + // 'whitelisted for background mode'. bool whitelisted_for_background_mode = IsMemoryDumpProviderWhitelisted(name); - scoped_refptr<MemoryDumpProviderInfo> mdpinfo = - new MemoryDumpProviderInfo(mdp, name, std::move(task_runner), options, - whitelisted_for_background_mode); + bool whitelisted_for_summary_mode = + IsMemoryDumpProviderWhitelistedForSummary(name); + + scoped_refptr<MemoryDumpProviderInfo> mdpinfo = new MemoryDumpProviderInfo( + mdp, name, std::move(task_runner), options, + whitelisted_for_background_mode, whitelisted_for_summary_mode); if (options.is_fast_polling_supported) { DCHECK(!mdpinfo->task_runner) << "MemoryDumpProviders capable of fast " @@ -563,6 +571,14 @@ return SetupNextMemoryDump(std::move(pmd_async_state)); } + // If we are in summary mode, we only need to invoke the providers + // whitelisted for summary mode. + if (pmd_async_state->req_args.dump_type == MemoryDumpType::SUMMARY_ONLY && + !mdpinfo->whitelisted_for_summary_mode) { + pmd_async_state->pending_dump_providers.pop_back(); + return SetupNextMemoryDump(std::move(pmd_async_state)); + } + // If the dump provider did not specify a task runner affinity, dump on // |dump_thread_|. SequencedTaskRunner* task_runner = mdpinfo->task_runner.get();
diff --git a/base/trace_event/memory_dump_manager_unittest.cc b/base/trace_event/memory_dump_manager_unittest.cc index dbb16a69..8e163b4 100644 --- a/base/trace_event/memory_dump_manager_unittest.cc +++ b/base/trace_event/memory_dump_manager_unittest.cc
@@ -63,7 +63,12 @@ const char* kMDPName = "TestDumpProvider"; const char* kWhitelistedMDPName = "WhitelistedTestDumpProvider"; -const char* const kTestMDPWhitelist[] = {kWhitelistedMDPName, nullptr}; +const char* kBackgroundButNotSummaryWhitelistedMDPName = + "BackgroundButNotSummaryWhitelistedTestDumpProvider"; +const char* const kTestMDPWhitelist[] = { + kWhitelistedMDPName, kBackgroundButNotSummaryWhitelistedMDPName, nullptr}; +const char* const kTestMDPWhitelistForSummary[] = {kWhitelistedMDPName, + nullptr}; void RegisterDumpProvider( MemoryDumpProvider* mdp, @@ -1081,10 +1086,34 @@ ASSERT_EQ(events[0]->id, events[2]->id); } +TEST_F(MemoryDumpManagerTest, SummaryOnlyWhitelisting) { + InitializeMemoryDumpManager(false /* is_coordinator */); + // Summary only MDPs are a subset of background MDPs. + SetDumpProviderWhitelistForTesting(kTestMDPWhitelist); + SetDumpProviderSummaryWhitelistForTesting(kTestMDPWhitelistForSummary); + + // Standard provider with default options (create dump for current process). + MockMemoryDumpProvider summaryMdp; + RegisterDumpProvider(&summaryMdp, nullptr, kDefaultOptions, + kWhitelistedMDPName); + MockMemoryDumpProvider backgroundMdp; + RegisterDumpProvider(&backgroundMdp, nullptr, kDefaultOptions, + kBackgroundButNotSummaryWhitelistedMDPName); + + EnableTracingWithLegacyCategories(MemoryDumpManager::kTraceCategory); + EXPECT_CALL(global_dump_handler_, RequestGlobalMemoryDump(_, _)).Times(1); + EXPECT_CALL(backgroundMdp, OnMemoryDump(_, _)).Times(0); + EXPECT_CALL(summaryMdp, OnMemoryDump(_, _)).Times(1); + RequestGlobalDumpAndWait(MemoryDumpType::SUMMARY_ONLY, + MemoryDumpLevelOfDetail::BACKGROUND); + DisableTracing(); +} + TEST_F(MemoryDumpManagerTest, SummaryOnlyDumpsArentAddedToTrace) { using trace_analyzer::Query; InitializeMemoryDumpManager(false /* is_coordinator */); + SetDumpProviderSummaryWhitelistForTesting(kTestMDPWhitelistForSummary); SetDumpProviderWhitelistForTesting(kTestMDPWhitelist); // Standard provider with default options (create dump for current process).
diff --git a/base/trace_event/memory_dump_provider_info.cc b/base/trace_event/memory_dump_provider_info.cc index 6bb7110..34784eb 100644 --- a/base/trace_event/memory_dump_provider_info.cc +++ b/base/trace_event/memory_dump_provider_info.cc
@@ -16,12 +16,14 @@ const char* name, scoped_refptr<SequencedTaskRunner> task_runner, const MemoryDumpProvider::Options& options, - bool whitelisted_for_background_mode) + bool whitelisted_for_background_mode, + bool whitelisted_for_summary_mode) : dump_provider(dump_provider), options(options), name(name), task_runner(std::move(task_runner)), whitelisted_for_background_mode(whitelisted_for_background_mode), + whitelisted_for_summary_mode(whitelisted_for_summary_mode), consecutive_failures(0), disabled(false) {}
diff --git a/base/trace_event/memory_dump_provider_info.h b/base/trace_event/memory_dump_provider_info.h index ca63a98..aeacea1 100644 --- a/base/trace_event/memory_dump_provider_info.h +++ b/base/trace_event/memory_dump_provider_info.h
@@ -58,7 +58,8 @@ const char* name, scoped_refptr<SequencedTaskRunner> task_runner, const MemoryDumpProvider::Options& options, - bool whitelisted_for_background_mode); + bool whitelisted_for_background_mode, + bool whitelisted_for_summary_mode); // It is safe to access the const fields below from any thread as they are // never mutated. @@ -80,6 +81,9 @@ // True if the dump provider is whitelisted for background mode. const bool whitelisted_for_background_mode; + // True if the dump provider is whitelisted for summary mode. + const bool whitelisted_for_summary_mode; + // These fields below, instead, are not thread safe and can be mutated only: // - On the |task_runner|, when not null (i.e. for thread-bound MDPS). // - By the MDM's background thread (or in any other way that guarantees
diff --git a/base/trace_event/memory_infra_background_whitelist.cc b/base/trace_event/memory_infra_background_whitelist.cc index 746068a..d5783d0 100644 --- a/base/trace_event/memory_infra_background_whitelist.cc +++ b/base/trace_event/memory_infra_background_whitelist.cc
@@ -40,6 +40,12 @@ nullptr // End of list marker. }; +// The names of dump providers whitelisted for summary tracing. +const char* const kDumpProviderSummaryWhitelist[] = { + "Malloc", "PartitionAlloc", "ProcessMemoryMetrics", "V8Isolate", + nullptr // End of list marker. +}; + // A list of string names that are allowed for the memory allocator dumps in // background mode. const char* const kAllocatorDumpNameWhitelist[] = { @@ -205,17 +211,28 @@ }; const char* const* g_dump_provider_whitelist = kDumpProviderWhitelist; +const char* const* g_dump_provider_whitelist_for_summary = + kDumpProviderSummaryWhitelist; const char* const* g_allocator_dump_name_whitelist = kAllocatorDumpNameWhitelist; +bool IsMemoryDumpProviderInList(const char* mdp_name, const char* const* list) { + for (size_t i = 0; list[i] != nullptr; ++i) { + if (strcmp(mdp_name, list[i]) == 0) + return true; + } + return false; +} + } // namespace bool IsMemoryDumpProviderWhitelisted(const char* mdp_name) { - for (size_t i = 0; g_dump_provider_whitelist[i] != nullptr; ++i) { - if (strcmp(mdp_name, g_dump_provider_whitelist[i]) == 0) - return true; - } - return false; + return IsMemoryDumpProviderInList(mdp_name, g_dump_provider_whitelist); +} + +bool IsMemoryDumpProviderWhitelistedForSummary(const char* mdp_name) { + return IsMemoryDumpProviderInList(mdp_name, + g_dump_provider_whitelist_for_summary); } bool IsMemoryAllocatorDumpNameWhitelisted(const std::string& name) { @@ -250,6 +267,10 @@ g_dump_provider_whitelist = list; } +void SetDumpProviderSummaryWhitelistForTesting(const char* const* list) { + g_dump_provider_whitelist_for_summary = list; +} + void SetAllocatorDumpNameWhitelistForTesting(const char* const* list) { g_allocator_dump_name_whitelist = list; }
diff --git a/base/trace_event/memory_infra_background_whitelist.h b/base/trace_event/memory_infra_background_whitelist.h index b8d704ae..11900109 100644 --- a/base/trace_event/memory_infra_background_whitelist.h +++ b/base/trace_event/memory_infra_background_whitelist.h
@@ -18,6 +18,10 @@ // Checks if the given |mdp_name| is in the whitelist. bool BASE_EXPORT IsMemoryDumpProviderWhitelisted(const char* mdp_name); +// Checks if the given |mdp_name| is required for summary dumps. +bool BASE_EXPORT +IsMemoryDumpProviderWhitelistedForSummary(const char* mdp_name); + // Checks if the given |name| matches any of the whitelisted patterns. bool BASE_EXPORT IsMemoryAllocatorDumpNameWhitelisted(const std::string& name); @@ -25,6 +29,8 @@ // the list must be nullptr. void BASE_EXPORT SetDumpProviderWhitelistForTesting(const char* const* list); void BASE_EXPORT +SetDumpProviderSummaryWhitelistForTesting(const char* const* list); +void BASE_EXPORT SetAllocatorDumpNameWhitelistForTesting(const char* const* list); } // namespace trace_event
diff --git a/base/trace_event/memory_peak_detector_unittest.cc b/base/trace_event/memory_peak_detector_unittest.cc index c158466d..1fdf60da 100644 --- a/base/trace_event/memory_peak_detector_unittest.cc +++ b/base/trace_event/memory_peak_detector_unittest.cc
@@ -177,7 +177,9 @@ MemoryDumpProvider::Options opt; opt.is_fast_polling_supported = true; scoped_refptr<MemoryDumpProviderInfo> mdp_info( - new MemoryDumpProviderInfo(mdp.get(), "Mock MDP", nullptr, opt, false)); + new MemoryDumpProviderInfo(mdp.get(), "Mock MDP", nullptr, opt, + false /* whitelisted_for_background_mode */, + false /* whitelisted_for_summary_mode */)); // The |mdp| instance will be destroyed together with the |mdp_info|. mdp_info->owned_dump_provider = std::move(mdp);
diff --git a/build/android/pylib/instrumentation/render_test.html.jinja b/build/android/pylib/instrumentation/render_test.html.jinja index ab84eb4f..60cefca 100644 --- a/build/android/pylib/instrumentation/render_test.html.jinja +++ b/build/android/pylib/instrumentation/render_test.html.jinja
@@ -1,14 +1,30 @@ <html> +<head> + <title>{{ test_name }}</title> + <script> + function toggleZoom() { + for (const img of document.getElementsByTagName("img")) { + if (img.hasAttribute('style')) { + img.removeAttribute('style'); + } else { + img.style.width = '100%'; + } + } + } + </script> +</head> +<body> <table> <tr> <th>Failure</th> <th>Golden</th> <th>Diff</th> </tr> - <tr> - <td><img src="{{ failure_link }}" width="100%"/></td> - <td><img src="{{ golden_link }}" width="100%"/></td> - <td><img src="{{ diff_link }}" width="100%"/></td> + <tr onclick="toggleZoom()"> + <td><img src="{{ failure_link }}" style="width: 100%" /></td> + <td><img src="{{ golden_link }}" style="width: 100%" /></td> + <td><img src="{{ diff_link }}" style="width: 100%" /></td> </tr> </table> +</body> </html>
diff --git a/build/android/pylib/local/device/local_device_instrumentation_test_run.py b/build/android/pylib/local/device/local_device_instrumentation_test_run.py index b436216..4b762c9 100644 --- a/build/android/pylib/local/device/local_device_instrumentation_test_run.py +++ b/build/android/pylib/local/device/local_device_instrumentation_test_run.py
@@ -578,6 +578,7 @@ template = jinja2_env.get_template(_JINJA_TEMPLATE_FILENAME) # pylint: disable=no-member processed_template_output = template.render( + test_name=failure_filename, failure_link=failure_link, golden_link=golden_link, diff_link=diff_link)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java index 0e71b3ea7..e956f15e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
@@ -279,7 +279,7 @@ // 1. Initializing the browser needs to be done once, and first. // 2. Creating a spare renderer takes time, in other threads and processes, so // start it sooner rather than later. Can be done several times. - // 3. Initializing the ResourcePrefetchPredictor is done once, and triggers + // 3. Initializing the LoadingPredictor is done once, and triggers // work on other threads, start it early. // 4. RequestThrottler first access has to be done only once. @@ -295,7 +295,7 @@ if (!initialized) { // (3) Profile profile = Profile.getLastUsedProfile(); - new ResourcePrefetchPredictor(profile).startInitialization(); + new LoadingPredictor(profile).startInitialization(); // (4) // The throttling database uses shared preferences, that can cause a @@ -981,7 +981,7 @@ break; case SpeculationParams.PREFETCH: Profile profile = Profile.getLastUsedProfile(); - new ResourcePrefetchPredictor(profile).stopPrefetching(mSpeculation.url); + new LoadingPredictor(profile).cancelPageLoadHint(mSpeculation.url); break; default: return; @@ -1005,7 +1005,7 @@ } switch (speculationMode) { case SpeculationParams.PREFETCH: - boolean didPrefetch = new ResourcePrefetchPredictor(profile).startPrefetching(url); + boolean didPrefetch = new LoadingPredictor(profile).prepareForPageLoad(url); if (didPrefetch) mSpeculation = SpeculationParams.forPrefetch(session, url); preconnect = !didPrefetch; break;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/LoadingPredictor.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/LoadingPredictor.java new file mode 100644 index 0000000..794aa0d5 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/LoadingPredictor.java
@@ -0,0 +1,66 @@ +// 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.customtabs; + +import org.chromium.base.ThreadUtils; +import org.chromium.base.annotations.JNINamespace; +import org.chromium.chrome.browser.profiles.Profile; + +/** + * Interface to the loading predictor. + * + * Allows chrome to hint at a likely future navigation. + */ +@JNINamespace("predictors") +class LoadingPredictor { + private static boolean sInitializationStarted; + + private final Profile mProfile; + + /** + * @param profile The profile used to get the loading predictor. + */ + public LoadingPredictor(Profile profile) { + mProfile = profile; + } + + /** + * Starts the asynchronous initialization of the loading predictor. + */ + public boolean startInitialization() { + ThreadUtils.assertOnUiThread(); + sInitializationStarted = true; + return nativeStartInitialization(mProfile); + } + + /** + * Hints at a future navigation to a URL. + * + * @param url The URL to prepare. + * @return false in case the LoadingPredictor is not usable. + */ + public boolean prepareForPageLoad(String url) { + ThreadUtils.assertOnUiThread(); + if (!sInitializationStarted) { + throw new RuntimeException("startInitialization() not called."); + } + return nativePrepareForPageLoad(mProfile, url); + } + + /** + * Indicates that a page load hint is no longer active. + * + * @param url The hinted URL. + * @return false in case the LoadingPredictor is not usable. + */ + public boolean cancelPageLoadHint(String url) { + ThreadUtils.assertOnUiThread(); + return nativeCancelPageLoadHint(mProfile, url); + } + + private static native boolean nativeStartInitialization(Profile profile); + private static native boolean nativePrepareForPageLoad(Profile profile, String url); + private static native boolean nativeCancelPageLoadHint(Profile profile, String url); +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ResourcePrefetchPredictor.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ResourcePrefetchPredictor.java deleted file mode 100644 index 215af89..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ResourcePrefetchPredictor.java +++ /dev/null
@@ -1,67 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.browser.customtabs; - -import org.chromium.base.ThreadUtils; -import org.chromium.base.annotations.JNINamespace; -import org.chromium.chrome.browser.profiles.Profile; - -/** - * Interface to the resource prefetch predictor. - * - * This allows to initiate and abort prefetches of likely subresources, based on - * the local browsing history. - */ -@JNINamespace("predictors") -class ResourcePrefetchPredictor { - private static boolean sInitializationStarted; - - private final Profile mProfile; - - /** - * @param profile The profile used to get the prefetch predictor. - */ - public ResourcePrefetchPredictor(Profile profile) { - mProfile = profile; - } - - /** - * Starts the asynchronous initialization of the prefetch predictor. - */ - public boolean startInitialization() { - ThreadUtils.assertOnUiThread(); - sInitializationStarted = true; - return nativeStartInitialization(mProfile); - } - - /** - * Starts a prefetch for a URL. - * - * @param url The URL to start the prefetch for. - * @return false in case the ResourcePrefetchPredictor is not usable. - */ - public boolean startPrefetching(String url) { - ThreadUtils.assertOnUiThread(); - if (!sInitializationStarted) { - throw new RuntimeException("startInitialization() not called."); - } - return nativeStartPrefetching(mProfile, url); - } - - /** - * Stops a prefetch for a URL, if one is in progress. - * - * @param url The URL to stop the prefetch of. - * @return false in case the ResourcePrefetchPredictor is not usable. - */ - public boolean stopPrefetching(String url) { - ThreadUtils.assertOnUiThread(); - return nativeStopPrefetching(mProfile, url); - } - - private static native boolean nativeStartInitialization(Profile profile); - private static native boolean nativeStartPrefetching(Profile profile, String url); - private static native boolean nativeStopPrefetching(Profile profile, String url); -}
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni index 921618d..c9c0e20a 100644 --- a/chrome/android/java_sources.gni +++ b/chrome/android/java_sources.gni
@@ -280,6 +280,7 @@ "java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java", "java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionService.java", "java/src/org/chromium/chrome/browser/customtabs/CustomTabTabPersistencePolicy.java", + "java/src/org/chromium/chrome/browser/customtabs/LoadingPredictor.java", "java/src/org/chromium/chrome/browser/customtabs/OriginVerifier.java", "java/src/org/chromium/chrome/browser/customtabs/PostMessageHandler.java", "java/src/org/chromium/chrome/browser/customtabs/RequestThrottler.java", @@ -295,7 +296,6 @@ "java/src/org/chromium/chrome/browser/customtabs/SeparateTaskCustomTabActivity8.java", "java/src/org/chromium/chrome/browser/customtabs/SeparateTaskCustomTabActivity9.java", "java/src/org/chromium/chrome/browser/customtabs/SeparateTaskManagedCustomTabActivity.java", - "java/src/org/chromium/chrome/browser/customtabs/ResourcePrefetchPredictor.java", "java/src/org/chromium/chrome/browser/database/SQLiteCursor.java", "java/src/org/chromium/chrome/browser/datausage/DataUseTabUIManager.java", "java/src/org/chromium/chrome/browser/datausage/ExternalDataUseObserver.java",
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkTest.java index aae99a9..e98e844c 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkTest.java
@@ -4,7 +4,6 @@ package org.chromium.chrome.browser.bookmarks; -import android.support.test.InstrumentationRegistry; import android.support.test.filters.MediumTest; import android.support.test.filters.SmallTest; import android.support.v7.widget.RecyclerView; @@ -14,24 +13,16 @@ import android.view.ViewGroup; import android.widget.TextView; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; +import junit.framework.Assert; import org.chromium.base.ThreadUtils; -import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.RetryOnFailure; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeActivity; -import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.UrlConstants; import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; import org.chromium.chrome.browser.widget.selection.SelectableListToolbar; -import org.chromium.chrome.test.ChromeActivityTestRule; -import org.chromium.chrome.test.ChromeJUnit4ClassRunner; +import org.chromium.chrome.test.ChromeActivityTestCaseBase; import org.chromium.chrome.test.util.ActivityUtils; import org.chromium.chrome.test.util.BookmarkTestUtil; import org.chromium.chrome.test.util.ChromeTabUtils; @@ -49,14 +40,12 @@ /** * Tests for the bookmark manager. */ -@RunWith(ChromeJUnit4ClassRunner.class) -@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, - ChromeActivityTestRule.DISABLE_NETWORK_PREDICTION_FLAG}) @RetryOnFailure -public class BookmarkTest { - @Rule - public ChromeActivityTestRule<ChromeActivity> mActivityTestRule = - new ChromeActivityTestRule<>(ChromeActivity.class); +public class BookmarkTest extends ChromeActivityTestCaseBase<ChromeActivity> { + + public BookmarkTest() { + super(ChromeActivity.class); + } private static final String TEST_PAGE_URL_GOOGLE = "/chrome/test/data/android/google.html"; private static final String TEST_PAGE_TITLE_GOOGLE = "The Google"; @@ -70,41 +59,41 @@ private String mTestPageFoo; private EmbeddedTestServer mTestServer; - @Before - public void setUp() throws Exception { - mActivityTestRule.startMainActivityFromLauncher(); - ThreadUtils.runOnUiThreadBlocking(new Runnable() { - @Override - public void run() { - mBookmarkModel = new BookmarkModel( - mActivityTestRule.getActivity().getActivityTab().getProfile()); - } - }); - BookmarkTestUtil.waitForBookmarkModelLoaded(); - mTestServer = EmbeddedTestServer.createAndStartServer( - InstrumentationRegistry.getInstrumentation().getContext()); + @Override + protected void setUp() throws Exception { + super.setUp(); + mTestServer = EmbeddedTestServer.createAndStartServer(getInstrumentation().getContext()); mTestPage = mTestServer.getURL(TEST_PAGE_URL_GOOGLE); mTestPageFoo = mTestServer.getURL(TEST_PAGE_URL_FOO); } - @After - public void tearDown() throws Exception { - if (mTestServer != null) { - mTestServer.stopAndDestroyServer(); - } + @Override + protected void tearDown() throws Exception { + mTestServer.stopAndDestroyServer(); + super.tearDown(); + } + + @Override + public void startMainActivity() throws InterruptedException { + startMainActivityFromLauncher(); + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + mBookmarkModel = new BookmarkModel(getActivity().getActivityTab().getProfile()); + } + }); + BookmarkTestUtil.waitForBookmarkModelLoaded(); } private void openBookmarkManager() throws InterruptedException { - if (DeviceFormFactor.isTablet(mActivityTestRule.getActivity())) { - mActivityTestRule.loadUrl(UrlConstants.BOOKMARKS_URL); - mItemsContainer = - (RecyclerView) mActivityTestRule.getActivity().findViewById(R.id.recycler_view); + if (DeviceFormFactor.isTablet(getActivity())) { + loadUrl(UrlConstants.BOOKMARKS_URL); + mItemsContainer = (RecyclerView) getActivity().findViewById(R.id.recycler_view); } else { // phone - BookmarkActivity activity = ActivityUtils.waitForActivity( - InstrumentationRegistry.getInstrumentation(), BookmarkActivity.class, - new MenuUtils.MenuActivityTrigger(InstrumentationRegistry.getInstrumentation(), - mActivityTestRule.getActivity(), R.id.all_bookmarks_menu_id)); + BookmarkActivity activity = ActivityUtils.waitForActivity(getInstrumentation(), + BookmarkActivity.class, new MenuUtils.MenuActivityTrigger( + getInstrumentation(), getActivity(), R.id.all_bookmarks_menu_id)); mItemsContainer = (RecyclerView) activity.findViewById(R.id.recycler_view); } } @@ -128,75 +117,67 @@ }); } - @Test @SmallTest public void testAddBookmark() throws InterruptedException { - mActivityTestRule.loadUrl(mTestPage); + loadUrl(mTestPage); // Click star button to bookmark the curent tab. - MenuUtils.invokeCustomMenuActionSync(InstrumentationRegistry.getInstrumentation(), - mActivityTestRule.getActivity(), R.id.bookmark_this_page_id); + MenuUtils.invokeCustomMenuActionSync(getInstrumentation(), getActivity(), + R.id.bookmark_this_page_id); // All actions with BookmarkModel needs to run on UI thread. ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { - long bookmarkIdLong = - mActivityTestRule.getActivity().getActivityTab().getUserBookmarkId(); + long bookmarkIdLong = getActivity().getActivityTab().getUserBookmarkId(); BookmarkId id = new BookmarkId(bookmarkIdLong, BookmarkType.NORMAL); - Assert.assertTrue("The test page is not added as bookmark: ", + assertTrue("The test page is not added as bookmark: ", mBookmarkModel.doesBookmarkExist(id)); BookmarkItem item = mBookmarkModel.getBookmarkById(id); - Assert.assertEquals(mBookmarkModel.getDefaultFolder(), item.getParentId()); - Assert.assertEquals(mTestPage, item.getUrl()); - Assert.assertEquals(TEST_PAGE_TITLE_GOOGLE, item.getTitle()); + assertEquals(mBookmarkModel.getDefaultFolder(), item.getParentId()); + assertEquals(mTestPage, item.getUrl()); + assertEquals(TEST_PAGE_TITLE_GOOGLE, item.getTitle()); } }); } - @Test @SmallTest public void testOpenBookmark() throws InterruptedException, ExecutionException { addBookmark(TEST_PAGE_TITLE_GOOGLE, mTestPage); openBookmarkManager(); - Assert.assertTrue("Grid view does not contain added bookmark: ", + assertTrue("Grid view does not contain added bookmark: ", isItemPresentInBookmarkList(TEST_PAGE_TITLE_GOOGLE)); final View tile = getViewWithText(mItemsContainer, TEST_PAGE_TITLE_GOOGLE); - ChromeTabUtils.waitForTabPageLoaded( - mActivityTestRule.getActivity().getActivityTab(), new Runnable() { - @Override - public void run() { - TouchCommon.singleClickView(tile); - } - }); - Assert.assertEquals(TEST_PAGE_TITLE_GOOGLE, - mActivityTestRule.getActivity().getActivityTab().getTitle()); + ChromeTabUtils.waitForTabPageLoaded(getActivity().getActivityTab(), new Runnable() { + @Override + public void run() { + TouchCommon.singleClickView(tile); + } + }); + assertEquals(TEST_PAGE_TITLE_GOOGLE, getActivity().getActivityTab().getTitle()); } - @Test @SmallTest public void testUrlComposition() { BookmarkId mobileId = mBookmarkModel.getMobileFolderId(); BookmarkId bookmarkBarId = mBookmarkModel.getDesktopFolderId(); BookmarkId otherId = mBookmarkModel.getOtherFolderId(); - Assert.assertEquals("chrome-native://bookmarks/folder/" + mobileId, + assertEquals("chrome-native://bookmarks/folder/" + mobileId, BookmarkUIState.createFolderUrl(mobileId).toString()); - Assert.assertEquals("chrome-native://bookmarks/folder/" + bookmarkBarId, + assertEquals("chrome-native://bookmarks/folder/" + bookmarkBarId, BookmarkUIState.createFolderUrl(bookmarkBarId).toString()); - Assert.assertEquals("chrome-native://bookmarks/folder/" + otherId, + assertEquals("chrome-native://bookmarks/folder/" + otherId, BookmarkUIState.createFolderUrl(otherId).toString()); } - @Test @SmallTest public void testOpenBookmarkManager() throws InterruptedException { openBookmarkManager(); BookmarkDelegate delegate = ((BookmarkItemsAdapter) mItemsContainer.getAdapter()).getDelegateForTesting(); - Assert.assertEquals(BookmarkUIState.STATE_FOLDER, delegate.getCurrentState()); - Assert.assertEquals("chrome-native://bookmarks/folder/3", - BookmarkUtils.getLastUsedUrl(mActivityTestRule.getActivity())); + assertEquals(BookmarkUIState.STATE_FOLDER, delegate.getCurrentState()); + assertEquals("chrome-native://bookmarks/folder/3", + BookmarkUtils.getLastUsedUrl(getActivity())); } - @Test @MediumTest public void testTopLevelFolders() throws InterruptedException { openBookmarkManager(); @@ -212,9 +193,9 @@ } }); - Assert.assertEquals(SelectableListToolbar.NAVIGATION_BUTTON_BACK, + assertEquals(SelectableListToolbar.NAVIGATION_BUTTON_BACK, toolbar.getNavigationButtonForTests()); - Assert.assertFalse(toolbar.getMenu().findItem(R.id.edit_menu_id).isVisible()); + assertFalse(toolbar.getMenu().findItem(R.id.edit_menu_id).isVisible()); // Call BookmarkActionBar#onClick() to activate the navigation button. ThreadUtils.runOnUiThreadBlocking(new Runnable() { @@ -225,13 +206,12 @@ }); // Check that we are in the root folder. - Assert.assertEquals("Bookmarks", toolbar.getTitle()); - Assert.assertEquals(SelectableListToolbar.NAVIGATION_BUTTON_NONE, + assertEquals("Bookmarks", toolbar.getTitle()); + assertEquals(SelectableListToolbar.NAVIGATION_BUTTON_NONE, toolbar.getNavigationButtonForTests()); - Assert.assertFalse(toolbar.getMenu().findItem(R.id.edit_menu_id).isVisible()); + assertFalse(toolbar.getMenu().findItem(R.id.edit_menu_id).isVisible()); } - @Test @MediumTest public void testSearchBookmarks() throws Exception { BookmarkPromoHeader.setShouldShowForTests(); @@ -242,7 +222,7 @@ BookmarkItemsAdapter adapter = ((BookmarkItemsAdapter) mItemsContainer.getAdapter()); final BookmarkDelegate delegate = adapter.getDelegateForTesting(); - Assert.assertEquals(BookmarkUIState.STATE_FOLDER, delegate.getCurrentState()); + assertEquals(BookmarkUIState.STATE_FOLDER, delegate.getCurrentState()); assertBookmarkItems("Wrong number of items before starting search.", 3, adapter, delegate); ThreadUtils.runOnUiThreadBlocking(new Runnable() { @@ -252,7 +232,7 @@ } }); - Assert.assertEquals(BookmarkUIState.STATE_SEARCHING, delegate.getCurrentState()); + assertEquals(BookmarkUIState.STATE_SEARCHING, delegate.getCurrentState()); assertBookmarkItems( "Wrong number of items after showing search UI. The promo should be hidden.", 2, adapter, delegate); @@ -281,7 +261,7 @@ }); assertBookmarkItems("Wrong number of items after closing search UI.", 3, mItemsContainer.getAdapter(), delegate); - Assert.assertEquals(BookmarkUIState.STATE_FOLDER, delegate.getCurrentState()); + assertEquals(BookmarkUIState.STATE_FOLDER, delegate.getCurrentState()); } /** @@ -297,11 +277,11 @@ // TODO(twellington): Remove after bookmarks redesign is complete. // The +1 for large devices stems from the divider being added to the state folder for now, // which will offset all counts by one. - final int expectedCount = DeviceFormFactor.isLargeTablet(mActivityTestRule.getActivity()) + final int expectedCount = DeviceFormFactor.isLargeTablet(getActivity()) && BookmarkUIState.STATE_FOLDER == delegate.getCurrentState() ? exepectedOnRegularDevice + 1 : exepectedOnRegularDevice; - Assert.assertEquals(errorMessage, expectedCount, adapter.getItemCount()); + assertEquals(errorMessage, expectedCount, adapter.getItemCount()); } /**
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 890cb3b8..7b3187b8 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -974,6 +974,8 @@ "predictors/glowplug_key_value_table.h", "predictors/loading_predictor.cc", "predictors/loading_predictor.h", + "predictors/loading_predictor_android.cc", + "predictors/loading_predictor_android.h", "predictors/loading_predictor_config.cc", "predictors/loading_predictor_config.h", "predictors/loading_predictor_factory.cc", @@ -988,8 +990,6 @@ "predictors/resource_prefetch_common.h", "predictors/resource_prefetch_predictor.cc", "predictors/resource_prefetch_predictor.h", - "predictors/resource_prefetch_predictor_android.cc", - "predictors/resource_prefetch_predictor_android.h", "predictors/resource_prefetch_predictor_tab_helper.cc", "predictors/resource_prefetch_predictor_tab_helper.h", "predictors/resource_prefetch_predictor_tables.cc", @@ -4146,8 +4146,8 @@ "../android/java/src/org/chromium/chrome/browser/contextualsearch/CtrSuppression.java", "../android/java/src/org/chromium/chrome/browser/cookies/CookiesFetcher.java", "../android/java/src/org/chromium/chrome/browser/crash/MinidumpUploadService.java", + "../android/java/src/org/chromium/chrome/browser/customtabs/LoadingPredictor.java", "../android/java/src/org/chromium/chrome/browser/customtabs/OriginVerifier.java", - "../android/java/src/org/chromium/chrome/browser/customtabs/ResourcePrefetchPredictor.java", "../android/java/src/org/chromium/chrome/browser/database/SQLiteCursor.java", "../android/java/src/org/chromium/chrome/browser/datausage/DataUseTabUIManager.java", "../android/java/src/org/chromium/chrome/browser/datausage/ExternalDataUseObserver.java",
diff --git a/chrome/browser/android/chrome_jni_registrar.cc b/chrome/browser/android/chrome_jni_registrar.cc index 5e3588b..f1135ca0 100644 --- a/chrome/browser/android/chrome_jni_registrar.cc +++ b/chrome/browser/android/chrome_jni_registrar.cc
@@ -136,7 +136,7 @@ #include "chrome/browser/payments/android/chrome_payments_jni_registrar.h" #include "chrome/browser/permissions/permission_dialog_delegate.h" #include "chrome/browser/permissions/permission_update_infobar_delegate_android.h" -#include "chrome/browser/predictors/resource_prefetch_predictor_android.h" +#include "chrome/browser/predictors/loading_predictor_android.h" #include "chrome/browser/prerender/external_prerender_handler_android.h" #include "chrome/browser/profiles/profile_android.h" #include "chrome/browser/search_engines/template_url_service_android.h" @@ -332,14 +332,12 @@ {"InstantAppsSettings", RegisterInstantAppsSettings}, {"InvalidationServiceFactory", invalidation::InvalidationServiceFactoryAndroid::Register}, - {"SimpleConfirmInfoBarBuilder", RegisterSimpleConfirmInfoBarBuilder}, - {"ShortcutHelper", ShortcutHelper::RegisterShortcutHelper}, {"JavascriptAppModalDialog", JavascriptAppModalDialogAndroid::RegisterJavascriptAppModalDialog}, {"LargeIconBridge", LargeIconBridge::RegisterLargeIconBridge}, {"LaunchMetrics", metrics::RegisterLaunchMetrics}, {"LayerTitleCache", RegisterLayerTitleCache}, - {"SpecialLocaleHandler", RegisterSpecialLocaleHandler}, + {"LoadingPredictor", predictors::RegisterLoadingPredictor}, {"LocationSettingsImpl", LocationSettingsImpl::Register}, {"LogoBridge", RegisterLogoBridge}, {"MediaDrmCredentialManager", @@ -396,8 +394,6 @@ {"RemoteMediaPlayerBridge", remote_media::RemoteMediaPlayerBridge::RegisterRemoteMediaPlayerBridge}, {"ResourceFactory", RegisterResourceFactory}, - {"ResourcePrefetchPredictor", - predictors::RegisterResourcePrefetchPredictor}, {"RevenueStats", chrome::android::RegisterRevenueStats}, {"RlzPingHandler", chrome::android::RegisterRlzPingHandler}, {"SafeBrowsing", safe_browsing::android::RegisterBrowserJNI}, @@ -408,10 +404,13 @@ SearchGeolocationDisclosureTabHelper::Register}, {"ServiceWorkerPaymentAppBridge", RegisterServiceWorkerPaymentAppBridge}, {"SessionTabHelper", RegisterSessionTabHelper}, + {"ShortcutHelper", ShortcutHelper::RegisterShortcutHelper}, {"SigninInvestigator", SigninInvestigatorAndroid::Register}, {"SigninManager", SigninManagerAndroid::Register}, + {"SimpleConfirmInfoBarBuilder", RegisterSimpleConfirmInfoBarBuilder}, {"SingleTabModel", RegisterSingleTabModel}, {"SiteEngagementService", SiteEngagementServiceAndroid::Register}, + {"SpecialLocaleHandler", RegisterSpecialLocaleHandler}, #if BUILDFLAG(ENABLE_SPELLCHECK) {"SpellCheckerSessionBridge", spellcheck::android::RegisterSpellcheckJni}, #endif
diff --git a/chrome/browser/android/webapk/webapk_icon_hasher_unittest.cc b/chrome/browser/android/webapk/webapk_icon_hasher_unittest.cc index c96f86a..98e703c 100644 --- a/chrome/browser/android/webapk/webapk_icon_hasher_unittest.cc +++ b/chrome/browser/android/webapk/webapk_icon_hasher_unittest.cc
@@ -38,7 +38,7 @@ void Run(const GURL& icon_url) { WebApkIconHasher::DownloadAndComputeMurmur2HashWithTimeout( - url_request_context_getter_.get(), icon_url, 100, + url_request_context_getter_.get(), icon_url, 300, base::Bind(&WebApkIconHasherRunner::OnCompleted, base::Unretained(this)));
diff --git a/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc b/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc index bfc6749..69657c97 100644 --- a/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc +++ b/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc
@@ -853,8 +853,7 @@ } // Tests that guests receive edit commands and respond appropriately. -// http://crbug.com/417892 -IN_PROC_BROWSER_TEST_P(WebViewInteractiveTest, DISABLED_EditCommandsNoMenu) { +IN_PROC_BROWSER_TEST_P(WebViewInteractiveTest, EditCommandsNoMenu) { SetupTest("web_view/edit_commands_no_menu", "/extensions/platform_apps/web_view/edit_commands_no_menu/" "guest.html");
diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc b/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc index 2e1c3e69..9ee7c9f 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc +++ b/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc
@@ -19,7 +19,6 @@ #include "base/strings/stringprintf.h" #include "base/sys_info.h" #include "base/task_scheduler/post_task.h" -#include "base/threading/sequenced_worker_pool.h" #include "base/version.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/app_mode/app_session.h" @@ -51,7 +50,6 @@ #include "components/signin/core/account_id/account_id.h" #include "components/user_manager/known_user.h" #include "components/user_manager/user_manager.h" -#include "content/public/browser/browser_thread.h" #include "extensions/common/extension_urls.h" #include "extensions/common/manifest_handlers/kiosk_mode_info.h" #include "third_party/cros_system_api/switches/chrome_switches.h" @@ -135,10 +133,9 @@ } scoped_refptr<base::SequencedTaskRunner> GetBackgroundTaskRunner() { - base::SequencedWorkerPool* pool = content::BrowserThread::GetBlockingPool(); - CHECK(pool); - return pool->GetSequencedTaskRunnerWithShutdownBehavior( - pool->GetSequenceToken(), base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); + return base::CreateSequencedTaskRunnerWithTraits( + {base::MayBlock(), base::TaskPriority::BACKGROUND, + base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}); } base::Version GetPlatformVersion() {
diff --git a/chrome/browser/extensions/api/sync_file_system/sync_file_system_browsertest.cc b/chrome/browser/extensions/api/sync_file_system/sync_file_system_browsertest.cc index 069c65da..5c4f1eb 100644 --- a/chrome/browser/extensions/api/sync_file_system/sync_file_system_browsertest.cc +++ b/chrome/browser/extensions/api/sync_file_system/sync_file_system_browsertest.cc
@@ -8,6 +8,7 @@ #include "base/json/json_reader.h" #include "base/macros.h" #include "base/run_loop.h" +#include "base/task_scheduler/post_task.h" #include "base/threading/sequenced_worker_pool.h" #include "base/threading/thread_task_runner_handle.h" #include "base/values.h" @@ -64,12 +65,8 @@ } scoped_refptr<base::SequencedTaskRunner> MakeSequencedTaskRunner() { - scoped_refptr<base::SequencedWorkerPool> worker_pool = - content::BrowserThread::GetBlockingPool(); - - return worker_pool->GetSequencedTaskRunnerWithShutdownBehavior( - worker_pool->GetSequenceToken(), - base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); + return base::CreateSequencedTaskRunnerWithTraits( + {base::MayBlock(), base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}); } void SetUpOnMainThread() override {
diff --git a/chrome/browser/predictors/loading_predictor.cc b/chrome/browser/predictors/loading_predictor.cc index 22f54d3..d5bd264 100644 --- a/chrome/browser/predictors/loading_predictor.cc +++ b/chrome/browser/predictors/loading_predictor.cc
@@ -25,6 +25,10 @@ resource_prefetch_predictor_->StopPrefetching(url); } +void LoadingPredictor::StartInitialization() { + resource_prefetch_predictor_->StartInitialization(); +} + ResourcePrefetchPredictor* LoadingPredictor::resource_prefetch_predictor() const { return resource_prefetch_predictor_.get();
diff --git a/chrome/browser/predictors/loading_predictor.h b/chrome/browser/predictors/loading_predictor.h index 37be5af0b..9bcdd81 100644 --- a/chrome/browser/predictors/loading_predictor.h +++ b/chrome/browser/predictors/loading_predictor.h
@@ -39,6 +39,9 @@ // Indicates that a page load hint is no longer active. void CancelPageLoadHint(const GURL& url); + // Starts initialization, will complete asynchronously. + void StartInitialization(); + // Don't use, internal only. ResourcePrefetchPredictor* resource_prefetch_predictor() const;
diff --git a/chrome/browser/predictors/resource_prefetch_predictor_android.cc b/chrome/browser/predictors/loading_predictor_android.cc similarity index 68% rename from chrome/browser/predictors/resource_prefetch_predictor_android.cc rename to chrome/browser/predictors/loading_predictor_android.cc index b0b2f969..83347d1f 100644 --- a/chrome/browser/predictors/resource_prefetch_predictor_android.cc +++ b/chrome/browser/predictors/loading_predictor_android.cc
@@ -1,8 +1,8 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. +// 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/predictors/resource_prefetch_predictor_android.h" +#include "chrome/browser/predictors/loading_predictor_android.h" #include "base/android/jni_android.h" #include "base/android/jni_string.h" @@ -12,7 +12,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_android.h" -#include "jni/ResourcePrefetchPredictor_jni.h" +#include "jni/LoadingPredictor_jni.h" using base::android::JavaParamRef; using base::android::ScopedJavaLocalRef; @@ -36,14 +36,14 @@ auto* loading_predictor = LoadingPredictorFromProfileAndroid(j_profile); if (!loading_predictor) return false; - loading_predictor->resource_prefetch_predictor()->StartInitialization(); + loading_predictor->StartInitialization(); return true; } -static jboolean StartPrefetching(JNIEnv* env, - const JavaParamRef<jclass>& clazz, - const JavaParamRef<jobject>& j_profile, - const JavaParamRef<jstring>& j_url) { +static jboolean PrepareForPageLoad(JNIEnv* env, + const JavaParamRef<jclass>& clazz, + const JavaParamRef<jobject>& j_profile, + const JavaParamRef<jstring>& j_url) { auto* loading_predictor = LoadingPredictorFromProfileAndroid(j_profile); if (!loading_predictor) return false; @@ -53,10 +53,10 @@ return true; } -static jboolean StopPrefetching(JNIEnv* env, - const JavaParamRef<jclass>& clazz, - const JavaParamRef<jobject>& j_profile, - const JavaParamRef<jstring>& j_url) { +static jboolean CancelPageLoadHint(JNIEnv* env, + const JavaParamRef<jclass>& clazz, + const JavaParamRef<jobject>& j_profile, + const JavaParamRef<jstring>& j_url) { auto* loading_predictor = LoadingPredictorFromProfileAndroid(j_profile); if (!loading_predictor) return false; @@ -66,7 +66,7 @@ return true; } -bool RegisterResourcePrefetchPredictor(JNIEnv* env) { +bool RegisterLoadingPredictor(JNIEnv* env) { return RegisterNativesImpl(env); }
diff --git a/chrome/browser/predictors/loading_predictor_android.h b/chrome/browser/predictors/loading_predictor_android.h new file mode 100644 index 0000000..af165aa --- /dev/null +++ b/chrome/browser/predictors/loading_predictor_android.h
@@ -0,0 +1,16 @@ +// 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_PREDICTORS_LOADING_PREDICTOR_ANDROID_H_ +#define CHROME_BROWSER_PREDICTORS_LOADING_PREDICTOR_ANDROID_H_ + +#include <jni.h> + +namespace predictors { + +bool RegisterLoadingPredictor(JNIEnv* env); + +} // namespace predictors + +#endif // CHROME_BROWSER_PREDICTORS_LOADING_PREDICTOR_ANDROID_H_
diff --git a/chrome/browser/predictors/resource_prefetch_predictor_android.h b/chrome/browser/predictors/resource_prefetch_predictor_android.h deleted file mode 100644 index 8437a01..0000000 --- a/chrome/browser/predictors/resource_prefetch_predictor_android.h +++ /dev/null
@@ -1,16 +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 CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_ANDROID_H_ -#define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_ANDROID_H_ - -#include <jni.h> - -namespace predictors { - -bool RegisterResourcePrefetchPredictor(JNIEnv* env); - -} // namespace predictors - -#endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_ANDROID_H_
diff --git a/chrome/browser/search/thumbnail_source.cc b/chrome/browser/search/thumbnail_source.cc index 95bfd6a2..2331ee0b 100644 --- a/chrome/browser/search/thumbnail_source.cc +++ b/chrome/browser/search/thumbnail_source.cc
@@ -41,9 +41,9 @@ ExtractPageAndThumbnailUrls(path, &page_url, &fallback_thumbnail_url); scoped_refptr<base::RefCountedMemory> data; - if (page_url.is_valid() && - thumbnail_service_->GetPageThumbnail(page_url, capture_thumbnails_, - &data)) { + if (page_url.is_valid() && thumbnail_service_->GetPageThumbnail( + page_url, + /*prefix_match=*/capture_thumbnails_, &data)) { // If a local thumbnail is available for the page's URL, provide it. callback.Run(data.get()); } else if (fallback_thumbnail_url.is_valid()) {
diff --git a/chrome/browser/sync_file_system/drive_backend/sync_engine.cc b/chrome/browser/sync_file_system/drive_backend/sync_engine.cc index 5f8fee8..e583a2e 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_engine.cc +++ b/chrome/browser/sync_file_system/drive_backend/sync_engine.cc
@@ -11,6 +11,7 @@ #include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" +#include "base/task_scheduler/post_task.h" #include "base/threading/sequenced_worker_pool.h" #include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" @@ -191,19 +192,16 @@ std::unique_ptr<SyncEngine> SyncEngine::CreateForBrowserContext( content::BrowserContext* context, TaskLogger* task_logger) { - scoped_refptr<base::SequencedWorkerPool> worker_pool = - content::BrowserThread::GetBlockingPool(); - scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner = base::ThreadTaskRunnerHandle::Get(); scoped_refptr<base::SequencedTaskRunner> worker_task_runner = - worker_pool->GetSequencedTaskRunnerWithShutdownBehavior( - worker_pool->GetSequenceToken(), - base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); + base::CreateSequencedTaskRunnerWithTraits( + {base::MayBlock(), base::TaskPriority::BACKGROUND, + base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}); scoped_refptr<base::SequencedTaskRunner> drive_task_runner = - worker_pool->GetSequencedTaskRunnerWithShutdownBehavior( - worker_pool->GetSequenceToken(), - base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); + base::CreateSequencedTaskRunnerWithTraits( + {base::MayBlock(), base::TaskPriority::BACKGROUND, + base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}); Profile* profile = Profile::FromBrowserContext(context); drive::DriveNotificationManager* notification_manager = @@ -220,7 +218,8 @@ std::unique_ptr<drive_backend::SyncEngine> sync_engine(new SyncEngine( ui_task_runner.get(), worker_task_runner.get(), drive_task_runner.get(), - worker_pool.get(), GetSyncFileSystemDir(context->GetPath()), task_logger, + content::BrowserThread::GetBlockingPool(), + GetSyncFileSystemDir(context->GetPath()), task_logger, notification_manager, extension_service, signin_manager, token_service, request_context.get(), base::MakeUnique<DriveServiceFactory>(), nullptr /* env_override */));
diff --git a/chrome/browser/ui/cocoa/app_menu/app_menu_controller.h b/chrome/browser/ui/cocoa/app_menu/app_menu_controller.h index 5718e87c..b3508a63 100644 --- a/chrome/browser/ui/cocoa/app_menu/app_menu_controller.h +++ b/chrome/browser/ui/cocoa/app_menu/app_menu_controller.h
@@ -9,7 +9,6 @@ #include <memory> -#include "base/mac/objc_property_releaser.h" #import "base/mac/scoped_nsobject.h" #include "base/time/time.h" #import "chrome/browser/ui/cocoa/has_weak_browser_pointer.h" @@ -132,8 +131,6 @@ MenuTrackedRootView* toolbarActionsOverflowItem_; BrowserActionsContainerView* overflowActionsContainerView_; - - base::mac::ObjCPropertyReleaser propertyReleaser_; } @property(retain, nonatomic) IBOutlet MenuTrackedRootView* editItem;
diff --git a/chrome/browser/ui/cocoa/app_menu/app_menu_controller.mm b/chrome/browser/ui/cocoa/app_menu/app_menu_controller.mm index c333a96..6670567 100644 --- a/chrome/browser/ui/cocoa/app_menu/app_menu_controller.mm +++ b/chrome/browser/ui/cocoa/app_menu/app_menu_controller.mm
@@ -8,6 +8,7 @@ #include "base/bind.h" #include "base/mac/bundle_locations.h" +#include "base/mac/objc_release_properties.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/metrics/histogram_macros.h" @@ -601,7 +602,6 @@ - (id)initWithController:(AppMenuController*)controller { if ((self = [super initWithNibName:@"AppMenu" bundle:base::mac::FrameworkBundle()])) { - propertyReleaser_.Init(self, [AppMenuButtonViewController class]); controller_ = controller; [[NSNotificationCenter defaultCenter] addObserver:self @@ -614,6 +614,7 @@ - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; + base::mac::ReleaseProperties(self); [super dealloc]; }
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm index 11b5a57..e4067979 100644 --- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm
@@ -11,7 +11,7 @@ #include "base/i18n/rtl.h" #include "base/mac/foundation_util.h" -#include "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #include "base/mac/scoped_nsobject.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" @@ -343,11 +343,6 @@ } // namespace -@interface OmniboxPopupCellData () { - base::mac::ObjCPropertyReleaser propertyReleaser_OmniboxPopupCellData_; -} -@end - @interface OmniboxPopupCell () - (CGFloat)drawMatchPart:(NSAttributedString*)attributedString withFrame:(NSRect)cellFrame @@ -418,12 +413,15 @@ } maxLines_ = 1; } - propertyReleaser_OmniboxPopupCellData_.Init(self, - [OmniboxPopupCellData class]); } return self; } +- (void)dealloc { + base::mac::ReleaseProperties(self); + [super dealloc]; +} + - (instancetype)copyWithZone:(NSZone*)zone { return [self retain]; }
diff --git a/chrome/browser/ui/views/payments/contact_info_editor_view_controller.cc b/chrome/browser/ui/views/payments/contact_info_editor_view_controller.cc index f9febb9..926ef21 100644 --- a/chrome/browser/ui/views/payments/contact_info_editor_view_controller.cc +++ b/chrome/browser/ui/views/payments/contact_info_editor_view_controller.cc
@@ -27,13 +27,9 @@ PaymentRequestState* state, PaymentRequestDialogView* dialog, BackNavigationType back_navigation_type, - base::OnceClosure on_edited, - base::OnceCallback<void(const autofill::AutofillProfile&)> on_added, autofill::AutofillProfile* profile) : EditorViewController(spec, state, dialog, back_navigation_type), - profile_to_edit_(profile), - on_edited_(std::move(on_edited)), - on_added_(std::move(on_added)) {} + profile_to_edit_(profile) {} ContactInfoEditorViewController::~ContactInfoEditorViewController() {} @@ -80,15 +76,12 @@ PopulateProfile(profile_to_edit_); state()->GetPersonalDataManager()->UpdateProfile(*profile_to_edit_); state()->profile_comparator()->Invalidate(*profile_to_edit_); - std::move(on_edited_).Run(); - on_added_.Reset(); } else { std::unique_ptr<autofill::AutofillProfile> profile = base::MakeUnique<autofill::AutofillProfile>(); PopulateProfile(profile.get()); state()->GetPersonalDataManager()->AddProfile(*profile); - std::move(on_added_).Run(*profile); - on_edited_.Reset(); + // TODO(crbug.com/712224): Add to profile cache in state_. } return true; }
diff --git a/chrome/browser/ui/views/payments/contact_info_editor_view_controller.h b/chrome/browser/ui/views/payments/contact_info_editor_view_controller.h index 5a0ab4a..b50ec9d 100644 --- a/chrome/browser/ui/views/payments/contact_info_editor_view_controller.h +++ b/chrome/browser/ui/views/payments/contact_info_editor_view_controller.h
@@ -25,14 +25,11 @@ // Does not take ownership of the arguments, which should outlive this object. // Passing nullptr as |profile| indicates that we are editing a new profile; // other arguments should never be null. - ContactInfoEditorViewController( - PaymentRequestSpec* spec, - PaymentRequestState* state, - PaymentRequestDialogView* dialog, - BackNavigationType back_navigation_type, - base::OnceClosure on_edited, - base::OnceCallback<void(const autofill::AutofillProfile&)> on_added, - autofill::AutofillProfile* profile); + ContactInfoEditorViewController(PaymentRequestSpec* spec, + PaymentRequestState* state, + PaymentRequestDialogView* dialog, + BackNavigationType back_navigation_type, + autofill::AutofillProfile* profile); ~ContactInfoEditorViewController() override; // EditorViewController: @@ -54,16 +51,11 @@ // Uses the values in the UI fields to populate the corresponding values in // |profile|. void PopulateProfile(autofill::AutofillProfile* profile); + bool GetSheetId(DialogViewID* sheet_id) override; autofill::AutofillProfile* profile_to_edit_; - // Called when |profile_to_edit_| was successfully edited. - base::OnceClosure on_edited_; - // Called when a new profile was added. The const reference is short-lived, - // and the callee should make a copy. - base::OnceCallback<void(const autofill::AutofillProfile&)> on_added_; - class ContactInfoValidationDelegate : public ValidationDelegate { public: ContactInfoValidationDelegate(const EditorField& field,
diff --git a/chrome/browser/ui/views/payments/contact_info_editor_view_controller_browsertest.cc b/chrome/browser/ui/views/payments/contact_info_editor_view_controller_browsertest.cc index 7c1ee91b..e656af7 100644 --- a/chrome/browser/ui/views/payments/contact_info_editor_view_controller_browsertest.cc +++ b/chrome/browser/ui/views/payments/contact_info_editor_view_controller_browsertest.cc
@@ -70,11 +70,6 @@ EXPECT_EQ(base::ASCIIToUTF16(kEmailAddress), profile->GetInfo(autofill::AutofillType(autofill::EMAIL_ADDRESS), GetLocale())); - - PaymentRequest* request = GetPaymentRequests(GetActiveWebContents()).front(); - EXPECT_EQ(1U, request->state()->contact_profiles().size()); - EXPECT_EQ(request->state()->contact_profiles().back(), - request->state()->selected_contact_profile()); } IN_PROC_BROWSER_TEST_F(PaymentRequestContactInfoEditorTest, @@ -218,66 +213,4 @@ GetLocale())); } -IN_PROC_BROWSER_TEST_F(PaymentRequestContactInfoEditorTest, - ModifyExistingSelectsIt) { - autofill::PersonalDataManager* personal_data_manager = GetDataManager(); - personal_data_manager->AddObserver(&personal_data_observer_); - - autofill::AutofillProfile incomplete_profile; - incomplete_profile.SetInfo(autofill::AutofillType(autofill::NAME_FULL), - base::ASCIIToUTF16(kNameFull), GetLocale()); - AddAutofillProfile(incomplete_profile); - - autofill::AutofillProfile other_incomplete_profile; - other_incomplete_profile.SetInfo(autofill::AutofillType(autofill::NAME_FULL), - base::ASCIIToUTF16("other"), GetLocale()); - AddAutofillProfile(other_incomplete_profile); - - InvokePaymentRequestUI(); - OpenContactInfoScreen(); - - PaymentRequest* request = GetPaymentRequests(GetActiveWebContents()).front(); - EXPECT_EQ(request->state()->contact_profiles().front(), - request->state()->selected_contact_profile()); - - views::View* list_view = dialog_view()->GetViewByID( - static_cast<int>(DialogViewID::CONTACT_INFO_SHEET_LIST_VIEW)); - DCHECK(list_view); - ClickOnDialogViewAndWait(list_view->child_at(1)); - - // Do not set name: This should have been populated when opening the screen. - EXPECT_EQ(base::ASCIIToUTF16(kNameFull), - GetEditorTextfieldValue(autofill::NAME_FULL)); - SetEditorTextfieldValue(base::ASCIIToUTF16(kPhoneNumber), - autofill::PHONE_HOME_WHOLE_NUMBER); - SetEditorTextfieldValue(base::ASCIIToUTF16(kEmailAddress), - autofill::EMAIL_ADDRESS); - - // Wait until the web database has been updated and the notification sent. - base::RunLoop save_data_loop; - EXPECT_CALL(personal_data_observer_, OnPersonalDataChanged()) - .WillOnce(QuitMessageLoop(&save_data_loop)); - ClickOnDialogViewAndWait(DialogViewID::EDITOR_SAVE_BUTTON); - save_data_loop.Run(); - - ASSERT_EQ(2UL, personal_data_manager->GetProfiles().size()); - autofill::AutofillProfile* profile = personal_data_manager->GetProfiles()[0]; - DCHECK(profile); - - EXPECT_EQ(base::ASCIIToUTF16(kNameFull), - profile->GetInfo(autofill::AutofillType(autofill::NAME_FULL), - GetLocale())); - EXPECT_EQ(base::ASCIIToUTF16(kPhoneNumber), - profile->GetInfo( - autofill::AutofillType(autofill::PHONE_HOME_WHOLE_NUMBER), - GetLocale())); - EXPECT_EQ(base::ASCIIToUTF16(kEmailAddress), - profile->GetInfo(autofill::AutofillType(autofill::EMAIL_ADDRESS), - GetLocale())); - - EXPECT_EQ(2U, request->state()->contact_profiles().size()); - EXPECT_EQ(request->state()->contact_profiles().back(), - request->state()->selected_contact_profile()); -} - } // namespace payments
diff --git a/chrome/browser/ui/views/payments/payment_request_dialog_view.cc b/chrome/browser/ui/views/payments/payment_request_dialog_view.cc index d1f472f..12c798d 100644 --- a/chrome/browser/ui/views/payments/payment_request_dialog_view.cc +++ b/chrome/browser/ui/views/payments/payment_request_dialog_view.cc
@@ -277,16 +277,13 @@ void PaymentRequestDialogView::ShowContactInfoEditor( BackNavigationType back_navigation_type, - base::OnceClosure on_edited, - base::OnceCallback<void(const autofill::AutofillProfile&)> on_added, autofill::AutofillProfile* profile) { - view_stack_->Push( - CreateViewAndInstallController( - base::MakeUnique<ContactInfoEditorViewController>( - request_->spec(), request_->state(), this, back_navigation_type, - std::move(on_edited), std::move(on_added), profile), - &controller_map_), - /* animate = */ true); + view_stack_->Push(CreateViewAndInstallController( + base::MakeUnique<ContactInfoEditorViewController>( + request_->spec(), request_->state(), this, + back_navigation_type, profile), + &controller_map_), + /* animate = */ true); if (observer_for_testing_) observer_for_testing_->OnContactInfoEditorOpened(); }
diff --git a/chrome/browser/ui/views/payments/payment_request_dialog_view.h b/chrome/browser/ui/views/payments/payment_request_dialog_view.h index f793e84..4e18583 100644 --- a/chrome/browser/ui/views/payments/payment_request_dialog_view.h +++ b/chrome/browser/ui/views/payments/payment_request_dialog_view.h
@@ -136,16 +136,10 @@ base::OnceCallback<void(const autofill::AutofillProfile&)> on_added, autofill::AutofillProfile* profile); // |profile| is the profile to be edited, or nullptr for adding a profile. - // |on_edited| is called when |profile| was successfully edited, and - // |on_added| is called when a new profile was added (the reference is - // short-lived; callee should make a copy of the profile object). // |back_navigation_type| identifies the type of navigation to execute once // the editor has completed successfully. - void ShowContactInfoEditor( - BackNavigationType back_navigation_type, - base::OnceClosure on_edited, - base::OnceCallback<void(const autofill::AutofillProfile&)> on_added, - autofill::AutofillProfile* profile = nullptr); + void ShowContactInfoEditor(BackNavigationType back_navigation_type, + autofill::AutofillProfile* profile = nullptr); void EditorViewUpdated(); void ShowCvcUnmaskPrompt(
diff --git a/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc b/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc index f34d57d1..715cc9d2 100644 --- a/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc +++ b/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc
@@ -89,6 +89,12 @@ return views::View::AcceleratorPressed(accelerator); } + void ViewHierarchyChanged( + const ViewHierarchyChangedDetails& details) override { + if (!details.is_add && details.child == first_focusable_) + first_focusable_ = nullptr; + } + views::View* first_focusable_; std::unique_ptr<views::FocusSearch> focus_search_; ui::Accelerator enter_key_accelerator_;
diff --git a/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc b/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc index 3e83ac61..6f5a599 100644 --- a/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc +++ b/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
@@ -526,12 +526,7 @@ case static_cast<int>( PaymentSheetViewControllerTags::ADD_CONTACT_INFO_BUTTON): - dialog()->ShowContactInfoEditor( - BackNavigationType::kPaymentSheet, - /*on_edited=*/base::OnceClosure(), // This is always an add. - /*on_added=*/ - base::BindOnce(&PaymentRequestState::AddAutofillContactProfile, - base::Unretained(state()), /*selected=*/true)); + dialog()->ShowContactInfoEditor(BackNavigationType::kPaymentSheet); break; case static_cast<int>(
diff --git a/chrome/browser/ui/views/payments/profile_list_view_controller.cc b/chrome/browser/ui/views/payments/profile_list_view_controller.cc index 657d5a6..f30561a6 100644 --- a/chrome/browser/ui/views/payments/profile_list_view_controller.cc +++ b/chrome/browser/ui/views/payments/profile_list_view_controller.cc
@@ -245,15 +245,7 @@ } void ShowEditor(autofill::AutofillProfile* profile) override { - dialog()->ShowContactInfoEditor( - BackNavigationType::kPaymentSheet, - /*on_edited=*/ - base::BindOnce(&PaymentRequestState::SetSelectedContactProfile, - base::Unretained(state()), profile), - /*on_added=*/ - base::BindOnce(&PaymentRequestState::AddAutofillContactProfile, - base::Unretained(state()), /*selected=*/true), - profile); + dialog()->ShowContactInfoEditor(BackNavigationType::kPaymentSheet, profile); } autofill::AutofillProfile* GetSelectedProfile() override {
diff --git a/components/autofill/ios/browser/js_suggestion_manager.mm b/components/autofill/ios/browser/js_suggestion_manager.mm index 0818252..80f5c113 100644 --- a/components/autofill/ios/browser/js_suggestion_manager.mm +++ b/components/autofill/ios/browser/js_suggestion_manager.mm
@@ -80,8 +80,6 @@ // 2) There is a race when the page is changing due to which // JSSuggestionManager has not yet injected __gCrWeb.suggestion object // Handle this case gracefully. - // TODO(shreyasv): Figure out / narrow down further why this occurs. - // crbug.com/432217. // If a page has overridden Array.toString, the string returned may not // contain a ",", hence this is a defensive measure to early return. NSArray* components = [result componentsSeparatedByString:@","];
diff --git a/components/favicon/core/favicon_handler.cc b/components/favicon/core/favicon_handler.cc index 1434eb5e..f811c350 100644 --- a/components/favicon/core/favicon_handler.cc +++ b/components/favicon/core/favicon_handler.cc
@@ -31,25 +31,6 @@ // the apple touch icon for iPad. const int kTouchIconSize = 144; -// Returns true if all of the icon URLs and icon types in |bitmap_results| are -// identical and if they match |icon_url| and |icon_type|. Returns false if -// |bitmap_results| is empty. -bool DoUrlsAndIconsMatch( - const GURL& icon_url, - favicon_base::IconType icon_type, - const std::vector<favicon_base::FaviconRawBitmapResult>& bitmap_results) { - if (bitmap_results.empty()) - return false; - - for (const auto& bitmap_result : bitmap_results) { - if (icon_url != bitmap_result.icon_url || - icon_type != bitmap_result.icon_type) { - return false; - } - } - return true; -} - // Return true if |bitmap_result| is expired. bool IsExpired(const favicon_base::FaviconRawBitmapResult& bitmap_result) { return bitmap_result.expired; @@ -482,14 +463,11 @@ redownload_icons_ = initial_history_result_expired_or_incomplete_ && !favicon_bitmap_results.empty(); - if (has_valid_result && (!current_candidate() || - DoUrlsAndIconsMatch(current_candidate()->icon_url, - current_candidate()->icon_type, - favicon_bitmap_results))) { - // The db knows the favicon (although it may be out of date) and the entry - // doesn't have an icon. Set the favicon now, and if the favicon turns out - // to be expired (or the wrong url) we'll fetch later on. This way the - // user doesn't see a flash of the default favicon. + if (has_valid_result) { + // The db knows the favicon (although it may be out of date). Set the + // favicon now, and if the favicon turns out to be expired (or the wrong + // url) we'll fetch later on. This way the user doesn't see a flash of the + // default favicon. NotifyFaviconUpdated(favicon_bitmap_results); }
diff --git a/components/handoff/handoff_manager.mm b/components/handoff/handoff_manager.mm index cdcb8f1..8300210 100644 --- a/components/handoff/handoff_manager.mm +++ b/components/handoff/handoff_manager.mm
@@ -5,7 +5,7 @@ #include "components/handoff/handoff_manager.h" #include "base/logging.h" -#include "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #include "base/mac/scoped_nsobject.h" #include "net/base/mac/url_conversions.h" @@ -34,7 +34,6 @@ @end @implementation HandoffManager { - base::mac::ObjCPropertyReleaser _propertyReleaser_HandoffManager; GURL _activeURL; NSUserActivity* _userActivity; handoff::Origin _origin; @@ -53,7 +52,6 @@ - (instancetype)init { self = [super init]; if (self) { - _propertyReleaser_HandoffManager.Init(self, [HandoffManager class]); #if defined(OS_MACOSX) && !defined(OS_IOS) _origin = handoff::ORIGIN_MAC; #elif defined(OS_IOS) @@ -65,6 +63,11 @@ return self; } +- (void)dealloc { + base::mac::ReleaseProperties(self); + [super dealloc]; +} + - (void)updateActiveURL:(const GURL&)url { #if defined(OS_MACOSX) && !defined(OS_IOS) // Handoff is only available on OSX 10.10+.
diff --git a/components/history/core/browser/top_sites.h b/components/history/core/browser/top_sites.h index 2b5e080..458899b 100644 --- a/components/history/core/browser/top_sites.h +++ b/components/history/core/browser/top_sites.h
@@ -25,8 +25,6 @@ namespace history { -class TopSitesObserver; - // PrepopulatedPage stores information for prepopulated page for the // initial run. struct PrepopulatedPage { @@ -142,7 +140,7 @@ // Adds or updates a |url| for which we should force the capture of a // thumbnail next time it's visited. If there is already a non-forced URL - // matching this |url| this call has no effect. Indicate this URL was laste + // matching this |url| this call has no effect. Indicate this URL was last // forced at |time| so we can evict the older URLs when needed. Should be // called from the UI thread. virtual bool AddForcedURL(const GURL& url, const base::Time& time) = 0;
diff --git a/components/history/core/browser/top_sites_cache.h b/components/history/core/browser/top_sites_cache.h index b7e10b99..37c94826 100644 --- a/components/history/core/browser/top_sites_cache.h +++ b/components/history/core/browser/top_sites_cache.h
@@ -16,12 +16,11 @@ #include "components/history/core/browser/url_utils.h" #include "url/gurl.h" -class GURL; - namespace history { -// TopSiteCache caches thumbnails for visited pages. Retrieving thumbnails from -// a given input URL is a two-stage process: +// TopSitesCache caches the top sites and thumbnails for TopSites. +// +// Retrieving thumbnails from a given input URL is a two-stage process: // // input URL --(map 1)--> canonical URL --(map 2)--> image. // @@ -38,8 +37,6 @@ // ignoring "?query#ref". // For the latter two "URL prefix matches", we prefer the match that is closest // to input URL, w.r.t. path hierarchy. - -// TopSitesCache caches the top sites and thumbnails for TopSites. class TopSitesCache { public: TopSitesCache();
diff --git a/components/history/core/browser/top_sites_impl.cc b/components/history/core/browser/top_sites_impl.cc index 72378e29..53171ff 100644 --- a/components/history/core/browser/top_sites_impl.cc +++ b/components/history/core/browser/top_sites_impl.cc
@@ -27,6 +27,7 @@ #include "components/history/core/browser/history_backend.h" #include "components/history/core/browser/history_constants.h" #include "components/history/core/browser/history_db_task.h" +#include "components/history/core/browser/history_service.h" #include "components/history/core/browser/page_usage_data.h" #include "components/history/core/browser/top_sites_cache.h" #include "components/history/core/browser/top_sites_observer.h" @@ -35,13 +36,10 @@ #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" #include "components/prefs/scoped_user_pref_update.h" -#include "ui/base/l10n/l10n_util.h" #include "ui/base/layout.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/image/image_util.h" -using base::DictionaryValue; - namespace history { namespace { @@ -51,12 +49,12 @@ const TopSitesImpl::GetMostVisitedURLsCallback& callback, const MostVisitedURLList& all_urls, const MostVisitedURLList& nonforced_urls) { - const MostVisitedURLList* urls = - include_forced_urls ? &all_urls : &nonforced_urls; + const MostVisitedURLList& urls = + include_forced_urls ? all_urls : nonforced_urls; if (task_runner->RunsTasksOnCurrentThread()) - callback.Run(*urls); + callback.Run(urls); else - task_runner->PostTask(FROM_HERE, base::Bind(callback, *urls)); + task_runner->PostTask(FROM_HERE, base::Bind(callback, urls)); } // Compares two MostVisitedURL having a non-null |last_forced_time|. @@ -109,8 +107,8 @@ const PrepopulatedPageList& prepopulated_pages, const CanAddURLToHistoryFn& can_add_url_to_history) : backend_(nullptr), - cache_(new TopSitesCache()), - thread_safe_cache_(new TopSitesCache()), + cache_(base::MakeUnique<TopSitesCache>()), + thread_safe_cache_(base::MakeUnique<TopSitesCache>()), last_num_urls_changed_(0), prepopulated_pages_(prepopulated_pages), pref_service_(pref_service), @@ -148,11 +146,10 @@ bool add_temp_thumbnail = false; if (!IsKnownURL(url)) { - if (!IsNonForcedFull()) { - add_temp_thumbnail = true; - } else { - return false; // This URL is not known to us. - } + if (IsNonForcedFull()) + return false; // We're full, and this URL is not known to us. + + add_temp_thumbnail = true; } if (!can_add_url_to_history_.Run(url)) @@ -229,13 +226,11 @@ if (url.SchemeIsHTTPOrHTTPS()) url_list.push_back(ToggleHTTPAndHTTPS(url)); - for (std::vector<GURL>::iterator it = url_list.begin(); - it != url_list.end(); ++it) { + for (const GURL& url : url_list) { base::AutoLock lock(lock_); - GURL canonical_url; // Test whether any stored URL is a prefix of |url|. - canonical_url = thread_safe_cache_->GetGeneralizedCanonicalURL(*it); + GURL canonical_url = thread_safe_cache_->GetGeneralizedCanonicalURL(url); if (!canonical_url.is_empty() && thread_safe_cache_->GetPageThumbnail(canonical_url, bytes)) { return true; @@ -255,10 +250,9 @@ bool TopSitesImpl::GetTemporaryPageThumbnailScore(const GURL& url, ThumbnailScore* score) { - for (TempImages::iterator i = temp_images_.begin(); i != temp_images_.end(); - ++i) { - if (i->first == url) { - *score = i->second.thumbnail_score; + for (const TempImage& temp_image : temp_images_) { + if (temp_image.first == url) { + *score = temp_image.second.thumbnail_score; return true; } } @@ -386,8 +380,7 @@ // since this is almost always where it needs to go, unless the user's local // clock is fiddled with. MostVisitedURLList::iterator mid = new_list.begin() + num_forced; - new_list.insert(mid, new_url); - mid = new_list.begin() + num_forced; // Mid was invalidated. + mid = new_list.insert(mid, new_url); std::inplace_merge(new_list.begin(), mid, mid + 1, ForcedURLComparator); SetTopSites(new_list, CALL_LOCATION_FROM_FORCED_URLS); return true; @@ -490,10 +483,9 @@ // Any member without the special marker in the all_old_urls list means that // there wasn't a "new" URL that mapped to it, so it was deleted. - for (std::map<GURL, size_t>::const_iterator i = all_old_urls.begin(); - i != all_old_urls.end(); ++i) { - if (i->second != kAlreadyFoundMarker) - delta->deleted.push_back(old_list[i->second]); + for (const std::pair<GURL, size_t>& old_url : all_old_urls) { + if (old_url.second != kAlreadyFoundMarker) + delta->deleted.push_back(old_list[old_url.second]); } } @@ -515,10 +507,11 @@ new_score_with_redirects.redirect_hops_from_dest = GetRedirectDistanceForURL(most_visited, url); - if (!ShouldReplaceThumbnailWith(image->thumbnail_score, - new_score_with_redirects) && - image->thumbnail.get()) + if (image->thumbnail.get() && + !ShouldReplaceThumbnailWith(image->thumbnail_score, + new_score_with_redirects)) { return false; // The one we already have is better. + } image->thumbnail = const_cast<base::RefCountedMemory*>(thumbnail_data); image->thumbnail_score = new_score_with_redirects; @@ -553,14 +546,14 @@ if (bitmap.IsEmpty()) return false; *bytes = new base::RefCountedBytes(); - std::vector<unsigned char> data; - if (!gfx::JPEG1xEncodedDataFromImage(bitmap, kTopSitesImageQuality, &data)) + if (!gfx::JPEG1xEncodedDataFromImage(bitmap, kTopSitesImageQuality, + &(*bytes)->data())) { return false; + } // As we're going to cache this data, make sure the vector is only as big as // it needs to be, as JPEGCodec::Encode() over-allocates data.capacity(). - // (In a C++0x future, we can just call shrink_to_fit() in Encode()) - (*bytes)->data() = data; + (*bytes)->data().shrink_to_fit(); return true; } @@ -574,16 +567,15 @@ } } -void TopSitesImpl::AddTemporaryThumbnail( - const GURL& url, - const base::RefCountedMemory* thumbnail, - const ThumbnailScore& score) { +void TopSitesImpl::AddTemporaryThumbnail(const GURL& url, + base::RefCountedMemory* thumbnail, + const ThumbnailScore& score) { if (temp_images_.size() == kMaxTempTopImages) - temp_images_.erase(temp_images_.begin()); + temp_images_.pop_front(); TempImage image; image.first = url; - image.second.thumbnail = const_cast<base::RefCountedMemory*>(thumbnail); + image.second.thumbnail = thumbnail; image.second.thumbnail_score = score; temp_images_.push_back(image); } @@ -604,7 +596,7 @@ } bool TopSitesImpl::AddPrepopulatedPages(MostVisitedURLList* urls, - size_t num_forced_urls) { + size_t num_forced_urls) const { bool added = false; for (const auto& prepopulated_page : prepopulated_pages_) { if (urls->size() - num_forced_urls < kNonForcedTopSitesNumber && @@ -616,7 +608,7 @@ return added; } -size_t TopSitesImpl::MergeCachedForcedURLs(MostVisitedURLList* new_list) { +size_t TopSitesImpl::MergeCachedForcedURLs(MostVisitedURLList* new_list) const { DCHECK(thread_checker_.CalledOnValidThread()); // Add all the new URLs for quick lookup. Take that opportunity to count the // number of forced URLs in |new_list|. @@ -685,13 +677,14 @@ } } +// static std::string TopSitesImpl::GetURLHash(const GURL& url) { // We don't use canonical URLs here to be able to blacklist only one of // the two 'duplicate' sites, e.g. 'gmail.com' and 'mail.google.com'. return base::MD5String(url.spec()); } -base::TimeDelta TopSitesImpl::GetUpdateDelay() { +base::TimeDelta TopSitesImpl::GetUpdateDelay() const { if (cache_->top_sites().size() <= prepopulated_pages_.size()) return base::TimeDelta::FromSeconds(30); @@ -740,11 +733,11 @@ // point the caches haven't been updated yet. cache_->SetTopSites(top_sites); - // See if we have any tmp thumbnails for the new sites. + // See if we have any temp thumbnails for the new sites, and promote them to + // proper thumbnails. if (!temp_images_.empty()) { - for (size_t i = 0; i < top_sites.size(); ++i) { - const MostVisitedURL& mv = top_sites[i]; - GURL canonical_url = cache_->GetCanonicalURL(mv.url); + for (const MostVisitedURL& mv : top_sites) { + const GURL& canonical_url = cache_->GetCanonicalURL(mv.url); // At the time we get the thumbnail redirects aren't known, so we have to // iterate through all the images. for (TempImages::iterator it = temp_images_.begin();
diff --git a/components/history/core/browser/top_sites_impl.h b/components/history/core/browser/top_sites_impl.h index c83cb0a..3024d448 100644 --- a/components/history/core/browser/top_sites_impl.h +++ b/components/history/core/browser/top_sites_impl.h
@@ -23,10 +23,8 @@ #include "base/threading/thread_checker.h" #include "base/time/time.h" #include "base/timer/timer.h" -#include "components/history/core/browser/history_service.h" #include "components/history/core/browser/history_service_observer.h" #include "components/history/core/browser/history_types.h" -#include "components/history/core/browser/page_usage_data.h" #include "components/history/core/browser/top_sites.h" #include "components/history/core/browser/top_sites_backend.h" #include "components/history/core/common/thumbnail_score.h" @@ -148,8 +146,7 @@ const MostVisitedURLList& new_list, TopSitesDelta* delta); - // Sets the thumbnail without writing to the database. Useful when - // reading last known top sites from the DB. + // Sets the thumbnail without writing to the database. // Returns true if the thumbnail was set, false if the existing one is better. bool SetPageThumbnailNoDB(const GURL& url, const base::RefCountedMemory* thumbnail_data, @@ -166,13 +163,13 @@ static bool EncodeBitmap(const gfx::Image& bitmap, scoped_refptr<base::RefCountedBytes>* bytes); - // Removes the cached thumbnail for url. Does nothing if |url| if not cached + // Removes the cached thumbnail for |url|. Does nothing if |url| is not cached // in |temp_images_|. void RemoveTemporaryThumbnailByURL(const GURL& url); - // Add a thumbnail for an unknown url. See temp_thumbnails_map_. + // Add a thumbnail for an unknown url. See |temp_images_|. void AddTemporaryThumbnail(const GURL& url, - const base::RefCountedMemory* thumbnail, + base::RefCountedMemory* thumbnail, const ThumbnailScore& score); // Called by our timer. Starts the query for the most visited sites. @@ -187,7 +184,7 @@ // Add prepopulated pages: 'welcome to Chrome' and themes gallery to |urls|. // Returns true if any pages were added. bool AddPrepopulatedPages(MostVisitedURLList* urls, - size_t num_forced_urls); + size_t num_forced_urls) const; // Add all the forced URLs from |cache_| into |new_list|, making sure not to // add any URL that's already in |new_list|'s non-forced URLs. The forced URLs @@ -195,7 +192,7 @@ // and be sorted in increasing |last_forced_time|. This will still be true // after the call. If the list of forced URLs overflows the older ones are // dropped. Returns the number of forced URLs after the merge. - size_t MergeCachedForcedURLs(MostVisitedURLList* new_list); + size_t MergeCachedForcedURLs(MostVisitedURLList* new_list) const; // Takes |urls|, produces it's copy in |out| after removing blacklisted URLs. // Also ensures we respect the maximum number of forced URLs and non-forced @@ -203,11 +200,11 @@ void ApplyBlacklist(const MostVisitedURLList& urls, MostVisitedURLList* out); // Returns an MD5 hash of the URL. Hashing is required for blacklisted URLs. - std::string GetURLHash(const GURL& url); + static std::string GetURLHash(const GURL& url); // Returns the delay until the next update of history is needed. - // Uses num_urls_changed - base::TimeDelta GetUpdateDelay(); + // Uses |last_num_urls_changed_|. + base::TimeDelta GetUpdateDelay() const; // Updates URLs in |cache_| and the db (in the background). // The non-forced URLs in |new_top_sites| replace those in |cache_|. @@ -258,8 +255,8 @@ std::unique_ptr<TopSitesCache> cache_; // Copy of the top sites data that may be accessed on any thread (assuming - // you hold |lock_|). The data in |thread_safe_cache_| has blacklisted and - // pinned urls applied (|cache_| does not). + // you hold |lock_|). The data in |thread_safe_cache_| has blacklisted urls + // applied (|cache_| does not). std::unique_ptr<TopSitesCache> thread_safe_cache_; // Lock used to access |thread_safe_cache_|. @@ -286,11 +283,11 @@ // Stores thumbnails for unknown pages. When SetPageThumbnail is // called, if we don't know about that URL yet and we don't have // enough Top Sites (new profile), we store it until the next - // SetNonForcedTopSites call. + // SetTopSites call. TempImages temp_images_; // URL List of prepopulated page. - PrepopulatedPageList prepopulated_pages_; + const PrepopulatedPageList prepopulated_pages_; // PrefService holding the NTP URL blacklist dictionary. Must outlive // TopSitesImpl.
diff --git a/components/history/core/browser/top_sites_impl_unittest.cc b/components/history/core/browser/top_sites_impl_unittest.cc index 0acd9fe..25c83ff 100644 --- a/components/history/core/browser/top_sites_impl_unittest.cc +++ b/components/history/core/browser/top_sites_impl_unittest.cc
@@ -20,6 +20,7 @@ #include "components/history/core/browser/history_constants.h" #include "components/history/core/browser/history_database_params.h" #include "components/history/core/browser/history_db_task.h" +#include "components/history/core/browser/history_service.h" #include "components/history/core/browser/history_types.h" #include "components/history/core/browser/top_sites.h" #include "components/history/core/browser/top_sites_cache.h"
diff --git a/components/ntp_tiles/constants.cc b/components/ntp_tiles/constants.cc index 6af7a172..20bf4c36 100644 --- a/components/ntp_tiles/constants.cc +++ b/components/ntp_tiles/constants.cc
@@ -18,6 +18,9 @@ extern const base::Feature kNtpMostLikelyFaviconsFromServerFeature{ "NTPMostLikelyFaviconsFromServer", base::FEATURE_DISABLED_BY_DEFAULT}; +extern const base::Feature kPinHomePageAsTileFeature{ + "PinHomePageAsTile", base::FEATURE_DISABLED_BY_DEFAULT}; + bool AreNtpMostLikelyFaviconsFromServerEnabled() { // Check if the experimental flag is forced on or off. base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
diff --git a/components/ntp_tiles/constants.h b/components/ntp_tiles/constants.h index 4af8d544..6619450 100644 --- a/components/ntp_tiles/constants.h +++ b/components/ntp_tiles/constants.h
@@ -23,6 +23,9 @@ // Likely tiles on the New Tab Page. extern const base::Feature kNtpMostLikelyFaviconsFromServerFeature; +// Feature to pin any set home page as first tile. +extern const base::Feature kPinHomePageAsTileFeature; + // Use this to find out whether the kNtpMostLikelyFaviconsFromServerFeature is // enabled. This helper function abstracts iOS special way to override the // feature (via command-line params).
diff --git a/components/payments/content/payment_request_state.cc b/components/payments/content/payment_request_state.cc index 1236b70..fb728d1 100644 --- a/components/payments/content/payment_request_state.cc +++ b/components/payments/content/payment_request_state.cc
@@ -166,18 +166,6 @@ SetSelectedShippingProfile(new_cached_profile); } -void PaymentRequestState::AddAutofillContactProfile( - bool selected, - const autofill::AutofillProfile& profile) { - profile_cache_.push_back( - base::MakeUnique<autofill::AutofillProfile>(profile)); - autofill::AutofillProfile* new_cached_profile = profile_cache_.back().get(); - contact_profiles_.push_back(new_cached_profile); - - if (selected) - SetSelectedContactProfile(new_cached_profile); -} - void PaymentRequestState::SetSelectedShippingOption( const std::string& shipping_option_id) { spec_->StartWaitingForUpdateWith(
diff --git a/components/payments/content/payment_request_state.h b/components/payments/content/payment_request_state.h index 72ea70ac5a..66241bd 100644 --- a/components/payments/content/payment_request_state.h +++ b/components/payments/content/payment_request_state.h
@@ -149,12 +149,6 @@ void AddAutofillShippingProfile(bool selected, const autofill::AutofillProfile& profile); - // Creates and adds an AutofillProfile as a contact profile, which makes a - // copy of |profile|. |selected| indicates if the newly-created shipping - // profile should be selected, after which observers will be notified. - void AddAutofillContactProfile(bool selected, - const autofill::AutofillProfile& profile); - // Setters to change the selected information. Will have the side effect of // recomputing "is ready to pay" and notify observers. void SetSelectedShippingOption(const std::string& shipping_option_id);
diff --git a/components/search_engines/template_url.cc b/components/search_engines/template_url.cc index 9df068a..1478d89 100644 --- a/components/search_engines/template_url.cc +++ b/components/search_engines/template_url.cc
@@ -98,63 +98,63 @@ return true; } -// Returns true if the search term placeholder is present, and also produces -// the constant prefix/suffix found. -bool TryMatchSearchParam(base::StringPiece text, - base::StringPiece pattern, - std::string* prefix, - std::string* suffix) { - auto pos = text.find(pattern); - if (pos == base::StringPiece::npos) - return false; - text.substr(0, pos).CopyToString(prefix); - text.substr(pos + pattern.length()).CopyToString(suffix); - return true; -} - -// Extract query key and host given a list of parameters coming from the URL -// query or ref. -struct SearchTermsKeyResult { - std::string key; - std::string value_prefix; - std::string value_suffix; - bool found() const { return !key.empty(); } -}; -SearchTermsKeyResult FindSearchTermsKey(const std::string& params) { - SearchTermsKeyResult result; - if (params.empty()) - return result; - url::Component query, key, value; - query.len = static_cast<int>(params.size()); - while (url::ExtractQueryKeyValue(params.c_str(), &query, &key, &value)) { - if (key.is_nonempty() && value.is_nonempty()) { - const base::StringPiece value_string(params.c_str() + value.begin, - value.len); - if (TryMatchSearchParam(value_string, kSearchTermsParameterFull, - &result.value_prefix, &result.value_suffix) || - TryMatchSearchParam(value_string, - kGoogleUnescapedSearchTermsParameterFull, - &result.value_prefix, &result.value_suffix)) { - result.key = params.substr(key.begin, key.len); - break; +// Finds the position of the search terms' parameter in the URL component. +class SearchTermLocation { + public: + SearchTermLocation(const base::StringPiece& url_component, + url::Parsed::ComponentType url_component_type) + : found_(false) { + if (url_component_type == url::Parsed::PATH) { + // GURL's constructor escapes "{" and "}" in the path of a passed string. + found_ = + TryMatchSearchParam(url_component, kSearchTermsParameterFullEscaped); + } else { + DCHECK((url_component_type == url::Parsed::QUERY) || + (url_component_type == url::Parsed::REF)); + url::Component query, key, value; + query.len = static_cast<int>(url_component.size()); + while (url::ExtractQueryKeyValue(url_component.data(), &query, &key, + &value)) { + if (key.is_nonempty() && value.is_nonempty()) { + const base::StringPiece value_string = + url_component.substr(value.begin, value.len); + if (TryMatchSearchParam(value_string, kSearchTermsParameterFull) || + TryMatchSearchParam(value_string, + kGoogleUnescapedSearchTermsParameterFull)) { + found_ = true; + url_component.substr(key.begin, key.len).CopyToString(&key_); + break; + } + } } } } - return result; -} -// Extract the position of the search terms' parameter in the URL path. -bool FindSearchTermsInPath(const std::string& path, - url::Component* parameter_position) { - DCHECK(parameter_position); - parameter_position->reset(); - const size_t begin = path.find(kSearchTermsParameterFullEscaped); - if (begin == std::string::npos) - return false; - parameter_position->begin = begin; - parameter_position->len = arraysize(kSearchTermsParameterFullEscaped) - 1; - return true; -} + bool found() const { return found_; } + const std::string& key() const { return key_; } + const std::string& value_prefix() const { return value_prefix_; } + const std::string& value_suffix() const { return value_suffix_; } + + private: + // Returns true if the search term placeholder is present, and also assigns + // the constant prefix/suffix found. + bool TryMatchSearchParam(const base::StringPiece& value, + const base::StringPiece& pattern) { + size_t pos = value.find(pattern); + if (pos == base::StringPiece::npos) + return false; + value.substr(0, pos).CopyToString(&value_prefix_); + value.substr(pos + pattern.length()).CopyToString(&value_suffix_); + return true; + } + + bool found_; + std::string key_; + std::string value_prefix_; + std::string value_suffix_; + + DISALLOW_COPY_AND_ASSIGN(SearchTermLocation); +}; bool IsTemplateParameterString(const std::string& param) { return (param.length() > 2) && (*(param.begin()) == kStartParameter) && @@ -212,7 +212,6 @@ parsed_(false), valid_(false), supports_replacements_(false), - search_term_position_in_path_(std::string::npos), search_term_key_location_(url::Parsed::QUERY), prepopulated_(false) { DCHECK(owner_); @@ -226,7 +225,6 @@ parsed_(false), valid_(false), supports_replacements_(false), - search_term_position_in_path_(std::string::npos), search_term_key_location_(url::Parsed::QUERY), prepopulated_(false) { DCHECK(owner_); @@ -393,20 +391,26 @@ return search_term_key_; } -size_t TemplateURLRef::GetSearchTermPositionInPath( - const SearchTermsData& search_terms_data) const { - ParseIfNecessary(search_terms_data); - return search_term_position_in_path_; -} - url::Parsed::ComponentType TemplateURLRef::GetSearchTermKeyLocation( const SearchTermsData& search_terms_data) const { ParseIfNecessary(search_terms_data); return search_term_key_location_; } +const std::string& TemplateURLRef::GetSearchTermValuePrefix( + const SearchTermsData& search_terms_data) const { + ParseIfNecessary(search_terms_data); + return search_term_value_prefix_; +} + +const std::string& TemplateURLRef::GetSearchTermValueSuffix( + const SearchTermsData& search_terms_data) const { + ParseIfNecessary(search_terms_data); + return search_term_value_suffix_; +} + base::string16 TemplateURLRef::SearchTermToString16( - const std::string& term) const { + const base::StringPiece& term) const { const std::vector<std::string>& encodings = owner_->input_encodings(); base::string16 result; @@ -472,30 +476,33 @@ return false; } - std::string source; + base::StringPiece source; url::Component position; if (search_term_key_location_ == url::Parsed::PATH) { - source = url.path(); + source = url.path_piece(); - // Characters in the path before and after search terms must match. - if (source.length() < path_.length()) + // If the path does not contain the expected prefix and suffix, then this is + // not a match. + if (source.size() < (search_term_value_prefix_.size() + + search_term_value_suffix_.size()) || + !source.starts_with(search_term_value_prefix_) || + !source.ends_with(search_term_value_suffix_)) return false; - position.begin = search_term_position_in_path_; - position.len = source.length() - path_.length(); - if (source.substr(0, position.begin) + source.substr(position.end()) != - path_) - return false; + position = + url::MakeRange(search_term_value_prefix_.size(), + source.length() - search_term_value_suffix_.size()); } else { DCHECK(search_term_key_location_ == url::Parsed::QUERY || search_term_key_location_ == url::Parsed::REF); - source = (search_term_key_location_ == url::Parsed::QUERY) ? - url.query() : url.ref(); + source = (search_term_key_location_ == url::Parsed::QUERY) + ? url.query_piece() + : url.ref_piece(); url::Component query, key, value; query.len = static_cast<int>(source.size()); bool key_found = false; - while (url::ExtractQueryKeyValue(source.c_str(), &query, &key, &value)) { + while (url::ExtractQueryKeyValue(source.data(), &query, &key, &value)) { if (key.is_nonempty()) { if (source.substr(key.begin, key.len) == search_term_key_) { // Fail if search term key is found twice. @@ -539,8 +546,9 @@ port_.clear(); path_.clear(); search_term_key_.clear(); - search_term_position_in_path_ = std::string::npos; search_term_key_location_ = url::Parsed::QUERY; + search_term_value_prefix_.clear(); + search_term_value_suffix_.clear(); replacements_.clear(); post_params_.clear(); } @@ -793,35 +801,34 @@ if (!url.is_valid()) return; - auto query_result = FindSearchTermsKey(url.query()); - auto ref_result = FindSearchTermsKey(url.ref()); - url::Component parameter_position; + SearchTermLocation query_result(url.query_piece(), url::Parsed::QUERY); + SearchTermLocation ref_result(url.ref_piece(), url::Parsed::REF); + SearchTermLocation path_result(url.path_piece(), url::Parsed::PATH); const bool in_query = query_result.found(); const bool in_ref = ref_result.found(); - const bool in_path = FindSearchTermsInPath(url.path(), ¶meter_position); + const bool in_path = path_result.found(); if (in_query ? (in_ref || in_path) : (in_ref == in_path)) return; // No key or multiple keys found. We only handle having one key. host_ = url.host(); port_ = url.port(); - path_ = url.path(); if (in_query) { - search_term_key_ = query_result.key; search_term_key_location_ = url::Parsed::QUERY; - search_term_value_prefix_ = query_result.value_prefix; - search_term_value_suffix_ = query_result.value_suffix; + search_term_key_ = query_result.key(); + search_term_value_prefix_ = query_result.value_prefix(); + search_term_value_suffix_ = query_result.value_suffix(); + path_ = url.path(); } else if (in_ref) { - search_term_key_ = ref_result.key; search_term_key_location_ = url::Parsed::REF; - search_term_value_prefix_ = ref_result.value_prefix; - search_term_value_suffix_ = ref_result.value_suffix; + search_term_key_ = ref_result.key(); + search_term_value_prefix_ = ref_result.value_prefix(); + search_term_value_suffix_ = ref_result.value_suffix(); + path_ = url.path(); } else { DCHECK(in_path); - DCHECK_GE(parameter_position.begin, 1); // Path must start with '/'. search_term_key_location_ = url::Parsed::PATH; - search_term_position_in_path_ = parameter_position.begin; - // Remove the "{searchTerms}" itself from |path_|. - path_.erase(parameter_position.begin, parameter_position.len); + search_term_value_prefix_ = path_result.value_prefix(); + search_term_value_suffix_ = path_result.value_suffix(); } }
diff --git a/components/search_engines/template_url.h b/components/search_engines/template_url.h index 242b4784..169997d 100644 --- a/components/search_engines/template_url.h +++ b/components/search_engines/template_url.h
@@ -238,20 +238,26 @@ const std::string& GetSearchTermKey( const SearchTermsData& search_terms_data) const; - // If this TemplateURLRef is valid and contains one search term - // in its path, this returns the length of the subpath before the search term, - // otherwise this returns std::string::npos. - size_t GetSearchTermPositionInPath( - const SearchTermsData& search_terms_data) const; - // If this TemplateURLRef is valid and contains one search term, // this returns the location of the search term, // otherwise this returns url::Parsed::QUERY. url::Parsed::ComponentType GetSearchTermKeyLocation( const SearchTermsData& search_terms_data) const; + // If this TemplateURLRef is valid and contains one search term, + // this returns the fixed prefix before the search term, + // otherwise this returns an empty string. + const std::string& GetSearchTermValuePrefix( + const SearchTermsData& search_terms_data) const; + + // If this TemplateURLRef is valid and contains one search term, + // this returns the fixed suffix after the search term, + // otherwise this returns an empty string. + const std::string& GetSearchTermValueSuffix( + const SearchTermsData& search_terms_data) const; + // Converts the specified term in our owner's encoding to a base::string16. - base::string16 SearchTermToString16(const std::string& term) const; + base::string16 SearchTermToString16(const base::StringPiece& term) const; // Returns true if this TemplateURLRef has a replacement term of // {google:baseURL} or {google:baseSuggestURL}. @@ -443,7 +449,6 @@ mutable std::string port_; mutable std::string path_; mutable std::string search_term_key_; - mutable size_t search_term_position_in_path_; mutable url::Parsed::ComponentType search_term_key_location_; mutable std::string search_term_value_prefix_; mutable std::string search_term_value_suffix_;
diff --git a/components/search_engines/template_url_unittest.cc b/components/search_engines/template_url_unittest.cc index 2b831485..f269e0f 100644 --- a/components/search_engines/template_url_unittest.cc +++ b/components/search_engines/template_url_unittest.cc
@@ -778,23 +778,23 @@ const std::string path; const std::string search_term_key; } test_data[] = { - { "http://blah/?foo=bar&q={searchTerms}&b=x", "blah", "/", "q"}, - { "http://blah/{searchTerms}", "blah", "/", ""}, + {"http://blah/?foo=bar&q={searchTerms}&b=x", "blah", "/", "q"}, + {"http://blah/{searchTerms}", "blah", "", ""}, - // No term should result in empty values. - { "http://blah/", "", "", ""}, + // No term should result in empty values. + {"http://blah/", "", "", ""}, - // Multiple terms should result in empty values. - { "http://blah/?q={searchTerms}&x={searchTerms}", "", "", ""}, + // Multiple terms should result in empty values. + {"http://blah/?q={searchTerms}&x={searchTerms}", "", "", ""}, - // Term in the host shouldn't match. - { "http://{searchTerms}", "", "", ""}, + // Term in the host shouldn't match. + {"http://{searchTerms}", "", "", ""}, - { "http://blah/?q={searchTerms}", "blah", "/", "q"}, - { "https://blah/?q={searchTerms}", "blah", "/", "q"}, + {"http://blah/?q={searchTerms}", "blah", "/", "q"}, + {"https://blah/?q={searchTerms}", "blah", "/", "q"}, - // Single term with extra chars in value should match. - { "http://blah/?q=stock:{searchTerms}", "blah", "/", "q"}, + // Single term with extra chars in value should match. + {"http://blah/?q=stock:{searchTerms}", "blah", "/", "q"}, }; for (size_t i = 0; i < arraysize(test_data); ++i) { @@ -813,28 +813,33 @@ const std::string url; const url::Parsed::ComponentType location; const std::string path; - size_t position_in_path; + const std::string key; + const std::string value_prefix; + const std::string value_suffix; } test_data[] = { - { "http://blah/{searchTerms}/", url::Parsed::PATH, "//", 1 }, - { "http://blah/{searchTerms}", url::Parsed::PATH, "/", 1 }, - { "http://blah/begin/{searchTerms}/end", url::Parsed::PATH, "/begin//end", 7 }, + {"http://blah/{searchTerms}/", url::Parsed::PATH, "", "", "/", "/"}, + {"http://blah/{searchTerms}", url::Parsed::PATH, "", "", "/", ""}, + {"http://blah/begin/{searchTerms}/end", url::Parsed::PATH, "", "", + "/begin/", "/end"}, + {"http://blah/?foo=bar&q={searchTerms}&b=x", url::Parsed::QUERY, "/", "q", + "", ""}, + {"http://blah/?foo=bar#x={searchTerms}&b=x", url::Parsed::REF, "/", "x", + "", ""}, + {"http://www.example.com/?q=chromium-{searchTerms}@chromium.org/info", + url::Parsed::QUERY, "/", "q", "chromium-", "@chromium.org/info"}, - { "http://blah/?foo=bar&q={searchTerms}&b=x", url::Parsed::QUERY, - "/", std::string::npos }, - { "http://blah/?foo=bar#x={searchTerms}&b=x", url::Parsed::REF, - "/", std::string::npos }, - // searchTerms is a key, not a value, so this should result in an empty - // value. - { "http://blah/?foo=bar#x=012345678901234&a=b&{searchTerms}=x", - url::Parsed::QUERY, std::string(), std::string::npos }, + // searchTerms is a key, not a value, so this should result in an empty + // value. + {"http://blah/?foo=bar#x=012345678901234&a=b&{searchTerms}=x", + url::Parsed::QUERY, "", "", "", ""}, - // Multiple search terms should result in empty values. - { "http://blah/{searchTerms}?q={searchTerms}", url::Parsed::QUERY, - "", std::string::npos }, - { "http://blah/{searchTerms}#x={searchTerms}", url::Parsed::QUERY, - "", std::string::npos }, - { "http://blah/?q={searchTerms}#x={searchTerms}", url::Parsed::QUERY, - "", std::string::npos }, + // Multiple search terms should result in empty values. + {"http://blah/{searchTerms}?q={searchTerms}", url::Parsed::QUERY, "", "", + "", ""}, + {"http://blah/{searchTerms}#x={searchTerms}", url::Parsed::QUERY, "", "", + "", ""}, + {"http://blah/?q={searchTerms}#x={searchTerms}", url::Parsed::QUERY, "", + "", "", ""}, }; for (size_t i = 0; i < arraysize(test_data); ++i) { @@ -845,8 +850,12 @@ url.url_ref().GetSearchTermKeyLocation(search_terms_data_)); EXPECT_EQ(test_data[i].path, url.url_ref().GetPath(search_terms_data_)); - EXPECT_EQ(test_data[i].position_in_path, - url.url_ref().GetSearchTermPositionInPath(search_terms_data_)); + EXPECT_EQ(test_data[i].key, + url.url_ref().GetSearchTermKey(search_terms_data_)); + EXPECT_EQ(test_data[i].value_prefix, + url.url_ref().GetSearchTermValuePrefix(search_terms_data_)); + EXPECT_EQ(test_data[i].value_suffix, + url.url_ref().GetSearchTermValueSuffix(search_terms_data_)); } }
diff --git a/content/browser/compositor/software_output_device_ozone_unittest.cc b/content/browser/compositor/software_output_device_ozone_unittest.cc index 703b68b..4a099e07 100644 --- a/content/browser/compositor/software_output_device_ozone_unittest.cc +++ b/content/browser/compositor/software_output_device_ozone_unittest.cc
@@ -7,7 +7,7 @@ #include <memory> #include "base/macros.h" -#include "base/message_loop/message_loop.h" +#include "base/test/scoped_task_environment.h" #include "base/threading/thread_task_runner_handle.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkCanvas.h" @@ -66,11 +66,11 @@ protected: std::unique_ptr<content::SoftwareOutputDeviceOzone> output_device_; - bool enable_pixel_output_; + bool enable_pixel_output_ = false; private: + base::test::ScopedTaskEnvironment scoped_task_environment_; std::unique_ptr<ui::Compositor> compositor_; - std::unique_ptr<base::MessageLoop> message_loop_; TestPlatformWindowDelegate window_delegate_; std::unique_ptr<ui::PlatformWindow> window_; @@ -78,9 +78,8 @@ }; SoftwareOutputDeviceOzoneTest::SoftwareOutputDeviceOzoneTest() - : enable_pixel_output_(false) { - message_loop_.reset(new base::MessageLoopForUI); -} + : scoped_task_environment_( + base::test::ScopedTaskEnvironment::MainThreadType::UI) {} SoftwareOutputDeviceOzoneTest::~SoftwareOutputDeviceOzoneTest() { }
diff --git a/content/browser/renderer_host/media/media_devices_dispatcher_host.cc b/content/browser/renderer_host/media/media_devices_dispatcher_host.cc index bde8b41..ece23f0 100644 --- a/content/browser/renderer_host/media/media_devices_dispatcher_host.cc +++ b/content/browser/renderer_host/media/media_devices_dispatcher_host.cc
@@ -21,6 +21,7 @@ #include "content/public/browser/media_device_id.h" #include "content/public/browser/render_frame_host.h" #include "content/public/common/media_stream_request.h" +#include "media/audio/audio_system.h" #include "media/base/video_facing.h" #include "mojo/public/cpp/bindings/strong_binding.h" #include "services/service_manager/public/cpp/interface_provider.h" @@ -96,6 +97,25 @@ } } +std::vector<::mojom::AudioInputDeviceCapabilitiesPtr> +ToVectorAudioInputDeviceCapabilitiesPtr( + const std::vector<::mojom::AudioInputDeviceCapabilities>& + capabilities_vector, + const url::Origin& security_origin, + const std::string& salt) { + std::vector<::mojom::AudioInputDeviceCapabilitiesPtr> result; + result.reserve(capabilities_vector.size()); + for (auto& capabilities : capabilities_vector) { + ::mojom::AudioInputDeviceCapabilitiesPtr capabilities_ptr = + ::mojom::AudioInputDeviceCapabilities::New(); + capabilities_ptr->device_id = + GetHMACForMediaDeviceID(salt, security_origin, capabilities.device_id); + capabilities_ptr->parameters = capabilities.parameters; + result.push_back(std::move(capabilities_ptr)); + } + return result; +} + } // namespace // static @@ -124,6 +144,7 @@ group_id_salt_(BrowserContext::CreateRandomMediaDeviceIDSalt()), media_stream_manager_(media_stream_manager), permission_checker_(base::MakeUnique<MediaDevicesPermissionChecker>()), + num_pending_audio_input_parameters_(0), weak_factory_(this) { DCHECK_CURRENTLY_ON(BrowserThread::IO); } @@ -183,6 +204,16 @@ weak_factory_.GetWeakPtr(), base::Passed(&client_callback))); } +void MediaDevicesDispatcherHost::GetAudioInputCapabilities( + GetAudioInputCapabilitiesCallback client_callback) { + base::PostTaskAndReplyWithResult( + BrowserThread::GetTaskRunnerForThread(BrowserThread::UI).get(), FROM_HERE, + base::Bind(GetOrigin, render_process_id_, render_frame_id_, + security_origin_for_testing_), + base::Bind(&MediaDevicesDispatcherHost::GetDefaultAudioInputDeviceID, + weak_factory_.GetWeakPtr(), base::Passed(&client_callback))); +} + void MediaDevicesDispatcherHost::SubscribeDeviceChangeNotifications( MediaDeviceType type, uint32_t subscription_id) { @@ -426,4 +457,101 @@ return formats; } +struct MediaDevicesDispatcherHost::AudioInputCapabilitiesRequest { + url::Origin security_origin; + GetAudioInputCapabilitiesCallback client_callback; +}; + +void MediaDevicesDispatcherHost::GetDefaultAudioInputDeviceID( + GetAudioInputCapabilitiesCallback client_callback, + const url::Origin& security_origin) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + pending_audio_input_capabilities_requests_.push_back( + AudioInputCapabilitiesRequest{security_origin, + std::move(client_callback)}); + if (pending_audio_input_capabilities_requests_.size() > 1U) + return; + + DCHECK(current_audio_input_capabilities_.empty()); + GetDefaultMediaDeviceID( + MEDIA_DEVICE_TYPE_AUDIO_INPUT, render_process_id_, render_frame_id_, + base::Bind(&MediaDevicesDispatcherHost::GotDefaultAudioInputDeviceID, + weak_factory_.GetWeakPtr())); +} + +void MediaDevicesDispatcherHost::GotDefaultAudioInputDeviceID( + const std::string& default_device_id) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_GT(pending_audio_input_capabilities_requests_.size(), 0U); + DCHECK(current_audio_input_capabilities_.empty()); + MediaDevicesManager::BoolDeviceTypes devices_to_enumerate; + devices_to_enumerate[MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true; + media_stream_manager_->media_devices_manager()->EnumerateDevices( + devices_to_enumerate, + base::Bind(&MediaDevicesDispatcherHost::GotAudioInputEnumeration, + weak_factory_.GetWeakPtr(), default_device_id)); +} + +void MediaDevicesDispatcherHost::GotAudioInputEnumeration( + const std::string& default_device_id, + const MediaDeviceEnumeration& enumeration) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_GT(pending_audio_input_capabilities_requests_.size(), 0U); + DCHECK(current_audio_input_capabilities_.empty()); + for (const auto& device_info : enumeration[MEDIA_DEVICE_TYPE_AUDIO_INPUT]) { + ::mojom::AudioInputDeviceCapabilities capabilities( + device_info.device_id, media::AudioParameters()); + if (device_info.device_id == default_device_id) + current_audio_input_capabilities_.insert( + current_audio_input_capabilities_.begin(), std::move(capabilities)); + else + current_audio_input_capabilities_.push_back(std::move(capabilities)); + } + // No devices, no need to read audio parameters. + if (current_audio_input_capabilities_.empty()) { + FinalizeGetAudioInputCapabilities(); + return; + } + + num_pending_audio_input_parameters_ = + current_audio_input_capabilities_.size(); + for (size_t i = 0; i < num_pending_audio_input_parameters_; ++i) { + media_stream_manager_->audio_system()->GetInputStreamParameters( + current_audio_input_capabilities_[i].device_id, + base::Bind(&MediaDevicesDispatcherHost::GotAudioInputParameters, + weak_factory_.GetWeakPtr(), i)); + } +} + +void MediaDevicesDispatcherHost::GotAudioInputParameters( + size_t index, + const media::AudioParameters& parameters) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_GT(pending_audio_input_capabilities_requests_.size(), 0U); + DCHECK_GT(current_audio_input_capabilities_.size(), index); + DCHECK_GT(num_pending_audio_input_parameters_, 0U); + + current_audio_input_capabilities_[index].parameters = + parameters.IsValid() ? parameters + : media::AudioParameters::UnavailableDeviceParams(); + if (--num_pending_audio_input_parameters_ == 0U) + FinalizeGetAudioInputCapabilities(); +} + +void MediaDevicesDispatcherHost::FinalizeGetAudioInputCapabilities() { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_GT(pending_audio_input_capabilities_requests_.size(), 0U); + DCHECK_EQ(0U, num_pending_audio_input_parameters_); + + for (auto& request : pending_audio_input_capabilities_requests_) { + std::move(request.client_callback) + .Run(ToVectorAudioInputDeviceCapabilitiesPtr( + current_audio_input_capabilities_, request.security_origin, + device_id_salt_)); + } + + current_audio_input_capabilities_.clear(); + pending_audio_input_capabilities_requests_.clear(); +} + } // namespace content
diff --git a/content/browser/renderer_host/media/media_devices_dispatcher_host.h b/content/browser/renderer_host/media/media_devices_dispatcher_host.h index f37e9906..47fc6a7 100644 --- a/content/browser/renderer_host/media/media_devices_dispatcher_host.h +++ b/content/browser/renderer_host/media/media_devices_dispatcher_host.h
@@ -51,6 +51,8 @@ EnumerateDevicesCallback client_callback) override; void GetVideoInputCapabilities( GetVideoInputCapabilitiesCallback client_callback) override; + void GetAudioInputCapabilities( + GetAudioInputCapabilitiesCallback client_callback) override; void SubscribeDeviceChangeNotifications(MediaDeviceType type, uint32_t subscription_id) override; void UnsubscribeDeviceChangeNotifications(MediaDeviceType type, @@ -102,6 +104,20 @@ const std::string& default_device_id, const media::VideoCaptureDeviceDescriptors& device_descriptors); + void GetDefaultAudioInputDeviceID( + GetAudioInputCapabilitiesCallback client_callback, + const url::Origin& security_origin); + + void GotDefaultAudioInputDeviceID(const std::string& default_device_id); + + void GotAudioInputEnumeration(const std::string& default_device_id, + const MediaDeviceEnumeration& enumeration); + + void GotAudioInputParameters(size_t index, + const media::AudioParameters& parameters); + + void FinalizeGetAudioInputCapabilities(); + // Returns the currently supported video formats for the given |device_id|. media::VideoCaptureFormats GetVideoInputFormats(const std::string& device_id); @@ -124,6 +140,14 @@ ::mojom::MediaDevicesListenerPtr device_change_listener_; url::Origin security_origin_for_testing_; + struct AudioInputCapabilitiesRequest; + // Queued requests for audio-input capabilities. + std::vector<AudioInputCapabilitiesRequest> + pending_audio_input_capabilities_requests_; + size_t num_pending_audio_input_parameters_; + std::vector<::mojom::AudioInputDeviceCapabilities> + current_audio_input_capabilities_; + base::WeakPtrFactory<MediaDevicesDispatcherHost> weak_factory_; DISALLOW_COPY_AND_ASSIGN(MediaDevicesDispatcherHost);
diff --git a/content/browser/renderer_host/media/media_devices_dispatcher_host_unittest.cc b/content/browser/renderer_host/media/media_devices_dispatcher_host_unittest.cc index 4664f2e..03df9e4 100644 --- a/content/browser/renderer_host/media/media_devices_dispatcher_host_unittest.cc +++ b/content/browser/renderer_host/media/media_devices_dispatcher_host_unittest.cc
@@ -47,6 +47,7 @@ const int kRenderId = 6; const size_t kNumFakeVideoDevices = 3; const char kDefaultVideoDeviceID[] = "/dev/video2"; +const char kDefaultAudioDeviceID[] = "fake_audio_input_2"; void PhysicalDevicesEnumerated(base::Closure quit_closure, MediaDeviceEnumeration* out, @@ -80,8 +81,10 @@ // Make sure we use fake devices to avoid long delays. base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kUseFakeDeviceForMediaStream, - base::StringPrintf("device-count=%zu, video-input-default-id=%s", - kNumFakeVideoDevices, kDefaultVideoDeviceID)); + base::StringPrintf("device-count=%zu, video-input-default-id=%s, " + "audio-input-default-id=%s", + kNumFakeVideoDevices, kDefaultVideoDeviceID, + kDefaultAudioDeviceID)); audio_manager_.reset(new media::MockAudioManager( base::MakeUnique<media::TestAudioThread>())); audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); @@ -117,6 +120,7 @@ MOCK_METHOD1(ValidOriginCallback, void(const std::vector<std::vector<MediaDeviceInfo>>&)); MOCK_METHOD0(MockVideoInputCapabilitiesCallback, void()); + MOCK_METHOD0(MockAudioInputCapabilitiesCallback, void()); void VideoInputCapabilitiesCallback( std::vector<::mojom::VideoInputDeviceCapabilitiesPtr> capabilities) { @@ -143,6 +147,20 @@ EXPECT_EQ(0U, capabilities.size()); } + void AudioInputCapabilitiesCallback( + std::vector<::mojom::AudioInputDeviceCapabilitiesPtr> capabilities) { + MockAudioInputCapabilitiesCallback(); + // MediaDevicesManager always returns 3 fake audio input devices. + const size_t kNumExpectedEntries = 3; + EXPECT_EQ(kNumExpectedEntries, capabilities.size()); + std::string expected_first_device_id = + GetHMACForMediaDeviceID(browser_context_.GetMediaDeviceIDSalt(), + origin_, kDefaultAudioDeviceID); + EXPECT_EQ(expected_first_device_id, capabilities[0]->device_id); + for (const auto& capability : capabilities) + EXPECT_TRUE(capability->parameters.IsValid()); + } + protected: void DevicesEnumerated( const base::Closure& closure, @@ -360,6 +378,16 @@ run_loop.Run(); } +TEST_P(MediaDevicesDispatcherHostTest, GetAudioInputCapabilities) { + base::RunLoop run_loop; + EXPECT_CALL(*this, MockAudioInputCapabilitiesCallback()) + .WillOnce(InvokeWithoutArgs([&run_loop]() { run_loop.Quit(); })); + host_->GetAudioInputCapabilities(base::Bind( + &MediaDevicesDispatcherHostTest::AudioInputCapabilitiesCallback, + base::Unretained(this))); + run_loop.Run(); +} + INSTANTIATE_TEST_CASE_P(, MediaDevicesDispatcherHostTest, testing::Values(GURL(), GURL("https://test.com")));
diff --git a/content/browser/renderer_host/media/media_stream_manager.cc b/content/browser/renderer_host/media/media_stream_manager.cc index 5818cef..9437850 100644 --- a/content/browser/renderer_host/media/media_stream_manager.cc +++ b/content/browser/renderer_host/media/media_stream_manager.cc
@@ -463,6 +463,11 @@ return media_devices_manager_.get(); } +media::AudioSystem* MediaStreamManager::audio_system() { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + return audio_system_; +} + void MediaStreamManager::AddVideoCaptureObserver( media::VideoCaptureObserver* capture_observer) { DCHECK_CURRENTLY_ON(BrowserThread::IO);
diff --git a/content/browser/renderer_host/media/media_stream_manager.h b/content/browser/renderer_host/media/media_stream_manager.h index e4d488e..3d4baa13 100644 --- a/content/browser/renderer_host/media/media_stream_manager.h +++ b/content/browser/renderer_host/media/media_stream_manager.h
@@ -105,6 +105,9 @@ // Used to access MediaDevicesManager. MediaDevicesManager* media_devices_manager(); + // Used to access AudioSystem. + media::AudioSystem* audio_system(); + // AddVideoCaptureObserver() and RemoveAllVideoCaptureObservers() must be // called after InitializeDeviceManagersOnIOThread() and before // WillDestroyCurrentMessageLoop(). They can be called more than once and it's
diff --git a/content/common/media/media_devices.mojom b/content/common/media/media_devices.mojom index 7d2d2cc..6940ccb 100644 --- a/content/common/media/media_devices.mojom +++ b/content/common/media/media_devices.mojom
@@ -5,6 +5,7 @@ module mojom; import "media/capture/mojo/video_capture_types.mojom"; +import "media/mojo/interfaces/audio_parameters.mojom"; [Native] enum MediaDeviceType; @@ -30,6 +31,11 @@ FacingMode facing_mode; }; +struct AudioInputDeviceCapabilities { + string device_id; + media.mojom.AudioParameters parameters; +}; + // This object lives in the browser and is responsible for processing device // enumeration requests and managing subscriptions for device-change // notifications. @@ -41,15 +47,26 @@ bool request_video_input, bool request_audio_output) => (array<array<MediaDeviceInfo>> enumeration); - + // Returns a list of video devices and their capabilities. // If there is a user-preferred device, it is the first in the result. // The result of this function is intended for the implementation details // of algorithms such as settings selection for getUserMedia. - // Do not expose the data contained in result of this function to JavaScript. + // Do not expose the data contained in the result of this function to + // JavaScript. GetVideoInputCapabilities() => (array<VideoInputDeviceCapabilities> video_input_device_capabilities); + // Returns a list of audio input devices and their capabilities. + // If there is a user-preferred device, it is the first in the result. + // Otherwise, the system-default device is the first in the result. + // The result of this function is intended for the implementation details + // of algorithms such as settings selection for getUserMedia. + // Do not expose the data contained in the result of this function to + // JavaScript. + GetAudioInputCapabilities() + => (array<AudioInputDeviceCapabilities> audio_input_device_capabilities); + // Creates a subscription for device-change notifications for the calling // frame/security origin. It is the responsibility of the caller to send // |subscription_id| values that are unique per device type.
diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn index 7586b63..9e0f781 100644 --- a/content/renderer/BUILD.gn +++ b/content/renderer/BUILD.gn
@@ -491,7 +491,6 @@ "//third_party/boringssl", "//third_party/icu", "//third_party/libyuv", - "//third_party/webrtc/api/audio_codecs:builtin_audio_decoder_factory", "//third_party/widevine/cdm:headers", "//ui/accessibility", "//ui/base", @@ -753,6 +752,8 @@ "//third_party/webrtc/api:libjingle_peerconnection", "//third_party/webrtc/api:rtc_stats_api", "//third_party/webrtc/api:video_frame_api", + "//third_party/webrtc/api/audio_codecs:builtin_audio_decoder_factory", + "//third_party/webrtc/api/audio_codecs:builtin_audio_encoder_factory", "//third_party/webrtc/base:rtc_base", "//third_party/webrtc/media:rtc_media", "//third_party/webrtc/media:rtc_media_base",
diff --git a/content/renderer/media/media_devices_event_dispatcher_unittest.cc b/content/renderer/media/media_devices_event_dispatcher_unittest.cc index 78b6db8..6c57038 100644 --- a/content/renderer/media/media_devices_event_dispatcher_unittest.cc +++ b/content/renderer/media/media_devices_event_dispatcher_unittest.cc
@@ -52,6 +52,11 @@ NOTREACHED(); } + void GetAudioInputCapabilities( + GetAudioInputCapabilitiesCallback client_callback) override { + NOTREACHED(); + } + ::mojom::MediaDevicesDispatcherHostPtr CreateInterfacePtrAndBind() { return binding_.CreateInterfacePtrAndBind(); }
diff --git a/content/renderer/media/user_media_client_impl_unittest.cc b/content/renderer/media/user_media_client_impl_unittest.cc index f0c5141..103ec7a 100644 --- a/content/renderer/media/user_media_client_impl_unittest.cc +++ b/content/renderer/media/user_media_client_impl_unittest.cc
@@ -159,6 +159,11 @@ std::move(client_callback).Run(std::move(result)); } + void GetAudioInputCapabilities( + GetAudioInputCapabilitiesCallback client_callback) override { + NOTREACHED(); + } + MOCK_METHOD2(SubscribeDeviceChangeNotifications, void(MediaDeviceType type, uint32_t subscription_id)); MOCK_METHOD2(UnsubscribeDeviceChangeNotifications,
diff --git a/content/renderer/media/webrtc/peer_connection_dependency_factory.cc b/content/renderer/media/webrtc/peer_connection_dependency_factory.cc index 6e4ebc4..dfb40366 100644 --- a/content/renderer/media/webrtc/peer_connection_dependency_factory.cc +++ b/content/renderer/media/webrtc/peer_connection_dependency_factory.cc
@@ -63,6 +63,7 @@ #include "third_party/WebKit/public/web/WebDocument.h" #include "third_party/WebKit/public/web/WebFrame.h" #include "third_party/webrtc/api/audio_codecs/builtin_audio_decoder_factory.h" +#include "third_party/webrtc/api/audio_codecs/builtin_audio_encoder_factory.h" #include "third_party/webrtc/api/mediaconstraintsinterface.h" #include "third_party/webrtc/api/videosourceproxy.h" #include "third_party/webrtc/base/ssladapter.h"
diff --git a/extensions/browser/updater/extension_downloader.cc b/extensions/browser/updater/extension_downloader.cc index 17982851..e7630ac 100644 --- a/extensions/browser/updater/extension_downloader.cc +++ b/extensions/browser/updater/extension_downloader.cc
@@ -39,6 +39,7 @@ #include "net/base/net_errors.h" #include "net/http/http_request_headers.h" #include "net/http/http_status_code.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" #include "net/url_request/url_request_status.h" @@ -481,9 +482,37 @@ ? kUpdateInteractivityForeground : kUpdateInteractivityBackground); + net::NetworkTrafficAnnotationTag traffic_annotation = + net::DefineNetworkTrafficAnnotation("extension_manifest_fetcher", R"( + semantics { + sender: "Extension Downloader" + description: + "Fetches information about an extension manifest (using its " + "update_url, which is usually Chrome WebStore) in order to update " + "the extension." + trigger: + "An update timer indicates that it's time to update extensions, or " + "a user triggers an extension update flow." + data: + "The extension id, the user's chromium version, and a flag stating " + "if the request originated in the foreground or the background." + destination: WEBSITE + } + policy { + cookies_allowed: false + setting: + "This feature cannot be disabled. It is only enabled when the user " + "has installed extentions." + chrome_policy { + ExtensionInstallBlacklist { + policy_options {mode: MANDATORY} + ExtensionInstallBlacklist: '*' + } + } + })"); manifest_fetcher_ = net::URLFetcher::Create(kManifestFetcherId, active_request->full_url(), - net::URLFetcher::GET, this); + net::URLFetcher::GET, this, traffic_annotation); manifest_fetcher_->SetRequestContext(request_context_.get()); manifest_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES | @@ -780,8 +809,37 @@ void ExtensionDownloader::CreateExtensionFetcher() { const ExtensionFetch* fetch = extensions_queue_.active_request(); - extension_fetcher_ = net::URLFetcher::Create(kExtensionFetcherId, fetch->url, - net::URLFetcher::GET, this); + net::NetworkTrafficAnnotationTag traffic_annotation = + net::DefineNetworkTrafficAnnotation("extension_crx_fetcher", R"( + semantics { + sender: "Extension Downloader" + description: + "Downloads an extension's crx file in order to update the " + "extension, using update_url from the extension's manifest which " + "is usually Chrome WebStore." + trigger: + "An update check indicates an extension update is available." + data: + "URL and required data to specify the extention to download. " + "OAuth2 token is also sent if connection is secure and to Google." + destination: WEBSITE + } + policy { + cookies_allowed: true + cookies_store: "user" + setting: + "This feature cannot be disabled. It is only enabled when the user " + "has installed extentions and it needs updating." + chrome_policy { + ExtensionInstallBlacklist { + policy_options {mode: MANDATORY} + ExtensionInstallBlacklist: '*' + } + } + })"); + extension_fetcher_ = + net::URLFetcher::Create(kExtensionFetcherId, fetch->url, + net::URLFetcher::GET, this, traffic_annotation); extension_fetcher_->SetRequestContext(request_context_.get()); extension_fetcher_->SetAutomaticallyRetryOnNetworkChanges(3);
diff --git a/headless/README.md b/headless/README.md index eebede1..e26a982 100644 --- a/headless/README.md +++ b/headless/README.md
@@ -127,9 +127,9 @@ Mailing list: [headless-dev@chromium.org](https://groups.google.com/a/chromium.org/forum/#!forum/headless-dev) -Bug tracker: [Proj=Headless](https://bugs.chromium.org/p/chromium/issues/list?can=2&q=Proj%3DHeadless) +Bug tracker: [Internals>Headless](https://bugs.chromium.org/p/chromium/issues/list?can=2&q=component%3AInternals%3EHeadless) -[File a new bug](https://bugs.chromium.org/p/chromium/issues/entry?labels=Proj-Headless) +[File a new bug](https://bugs.chromium.org/p/chromium/issues/entry?components=Internals%3EHeadless) ([bit.ly/2pP6SBb](https://bit.ly/2pP6SBb)) * [BeginFrame sequence numbers + acknowledgements](https://docs.google.com/document/d/1nxaunQ0cYWxhtS6Zzfwa99nae74F7gxanbuT5JRpI6Y/edit#) * [Deterministic page loading for Blink](https://docs.google.com/document/d/19s2g4fPP9p9qmMZvwPX8uDGbb-39rgR9k56B4B-ueG8/edit#)
diff --git a/ios/chrome/app/main_controller.mm b/ios/chrome/app/main_controller.mm index a45ae0a1..6321c20 100644 --- a/ios/chrome/app/main_controller.mm +++ b/ios/chrome/app/main_controller.mm
@@ -18,7 +18,7 @@ #import "base/mac/bind_objc_block.h" #include "base/mac/bundle_locations.h" #include "base/mac/foundation_util.h" -#include "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #import "base/mac/scoped_nsobject.h" #include "base/macros.h" #include "base/path_service.h" @@ -132,8 +132,8 @@ #include "ios/public/provider/chrome/browser/signin/chrome_identity_service.h" #import "ios/public/provider/chrome/browser/user_feedback/user_feedback_provider.h" #import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" -#import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoFontLoader.h" #import "ios/third_party/material_roboto_font_loader_ios/src/src/MDCTypographyAdditions/MDFRobotoFontLoader+MDCTypographyAdditions.h" +#import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoFontLoader.h" #include "ios/web/net/request_tracker_factory_impl.h" #include "ios/web/net/request_tracker_impl.h" #include "ios/web/net/web_http_protocol_handler_delegate.h" @@ -331,8 +331,6 @@ // appropriate pref changes. base::scoped_nsobject<MemoryDebuggerManager> _memoryDebuggerManager; - base::mac::ObjCPropertyReleaser _propertyReleaser_MainController; - // Responsible for indexing chrome links (such as bookmarks, most likely...) // in system Spotlight index. base::scoped_nsobject<SpotlightManager> _spotlightManager; @@ -549,7 +547,6 @@ - (instancetype)init { if ((self = [super init])) { - _propertyReleaser_MainController.Init(self, [MainController class]); _startupTasks.reset([[StartupTasks alloc] init]); } return self; @@ -560,6 +557,7 @@ net::HTTPProtocolHandlerDelegate::SetInstance(nullptr); net::RequestTracker::SetRequestTrackerFactory(nullptr); [NSObject cancelPreviousPerformRequestsWithTarget:self]; + base::mac::ReleaseProperties(self); [super dealloc]; }
diff --git a/ios/chrome/browser/DEPS b/ios/chrome/browser/DEPS index fbede3b9..b318bf2 100644 --- a/ios/chrome/browser/DEPS +++ b/ios/chrome/browser/DEPS
@@ -103,6 +103,7 @@ "+rlz/features", "+third_party/brotli", "+third_party/google_toolbox_for_mac", + "+third_party/libaddressinput", "+ui", # Those depend on //content; exclude them.
diff --git a/ios/chrome/browser/autofill/BUILD.gn b/ios/chrome/browser/autofill/BUILD.gn index 9613099..bf9d7d0 100644 --- a/ios/chrome/browser/autofill/BUILD.gn +++ b/ios/chrome/browser/autofill/BUILD.gn
@@ -19,6 +19,8 @@ "form_suggestion_view_client.h", "personal_data_manager_factory.cc", "personal_data_manager_factory.h", + "validation_rules_storage_factory.cc", + "validation_rules_storage_factory.h", ] deps = [ "//base", @@ -27,6 +29,7 @@ "//components/autofill/ios/browser", "//components/keyed_service/core", "//components/keyed_service/ios", + "//components/prefs", "//components/signin/core/browser", "//ios/chrome/app/strings", "//ios/chrome/browser", @@ -35,6 +38,7 @@ "//ios/chrome/browser/signin", "//ios/chrome/browser/ui", "//ios/web", + "//third_party/libaddressinput", "//ui/base", "//url", ]
diff --git a/ios/chrome/browser/autofill/validation_rules_storage_factory.cc b/ios/chrome/browser/autofill/validation_rules_storage_factory.cc new file mode 100644 index 0000000..d23556b --- /dev/null +++ b/ios/chrome/browser/autofill/validation_rules_storage_factory.cc
@@ -0,0 +1,47 @@ +// 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 "ios/chrome/browser/autofill/validation_rules_storage_factory.h" + +#include "base/files/file_path.h" +#include "base/path_service.h" +#include "base/threading/sequenced_worker_pool.h" +#include "components/prefs/json_pref_store.h" +#include "components/prefs/pref_filter.h" +#include "ios/chrome/browser/chrome_paths.h" +#include "ios/web/public/web_thread.h" +#include "third_party/libaddressinput/chromium/chrome_storage_impl.h" + +namespace autofill { + +using ::i18n::addressinput::Storage; + +// static +std::unique_ptr<Storage> ValidationRulesStorageFactory::CreateStorage() { + static base::LazyInstance<ValidationRulesStorageFactory>::DestructorAtExit + instance = LAZY_INSTANCE_INITIALIZER; + return std::unique_ptr<Storage>( + new ChromeStorageImpl(instance.Get().json_pref_store_.get())); +} + +ValidationRulesStorageFactory::ValidationRulesStorageFactory() { + base::FilePath user_data_dir; + bool success = PathService::Get(ios::DIR_USER_DATA, &user_data_dir); + DCHECK(success); + + base::FilePath cache = + user_data_dir.Append(FILE_PATH_LITERAL("Address Validation Rules")); + + scoped_refptr<base::SequencedTaskRunner> task_runner = + JsonPrefStore::GetTaskRunnerForFile(cache, + web::WebThread::GetBlockingPool()); + + json_pref_store_ = new JsonPrefStore(cache, task_runner.get(), + std::unique_ptr<PrefFilter>()); + json_pref_store_->ReadPrefsAsync(NULL); +} + +ValidationRulesStorageFactory::~ValidationRulesStorageFactory() {} + +} // namespace autofill
diff --git a/ios/chrome/browser/autofill/validation_rules_storage_factory.h b/ios/chrome/browser/autofill/validation_rules_storage_factory.h new file mode 100644 index 0000000..6277ee6 --- /dev/null +++ b/ios/chrome/browser/autofill/validation_rules_storage_factory.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 IOS_CHROME_BROWSER_AUTOFILL_VALIDATION_RULES_STORAGE_FACTORY_H_ +#define IOS_CHROME_BROWSER_AUTOFILL_VALIDATION_RULES_STORAGE_FACTORY_H_ + +#include <memory> + +#include "base/lazy_instance.h" +#include "base/macros.h" +#include "base/memory/ref_counted.h" + +namespace i18n { +namespace addressinput { +class Storage; +} +} + +class JsonPrefStore; + +namespace autofill { + +// Creates Storage objects, all of which are backed by a common pref store. +// Adapted for iOS from +// chrome/browser/autofill/validation_rules_storage_factory.{cc,h}, to use +// storage paths specific to iOS. +class ValidationRulesStorageFactory { + public: + static std::unique_ptr<::i18n::addressinput::Storage> CreateStorage(); + + private: + friend struct base::LazyInstanceTraitsBase<ValidationRulesStorageFactory>; + + ValidationRulesStorageFactory(); + ~ValidationRulesStorageFactory(); + + scoped_refptr<JsonPrefStore> json_pref_store_; + + DISALLOW_COPY_AND_ASSIGN(ValidationRulesStorageFactory); +}; + +} // namespace autofill + +#endif // IOS_CHROME_BROWSER_AUTOFILL_VALIDATION_RULES_STORAGE_FACTORY_H_
diff --git a/ios/chrome/browser/passwords/update_password_infobar_controller.mm b/ios/chrome/browser/passwords/update_password_infobar_controller.mm index 656b3bb..22d6a445 100644 --- a/ios/chrome/browser/passwords/update_password_infobar_controller.mm +++ b/ios/chrome/browser/passwords/update_password_infobar_controller.mm
@@ -4,7 +4,7 @@ #import "ios/chrome/browser/passwords/update_password_infobar_controller.h" -#import "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #include "base/strings/string_util.h" #include "base/strings/sys_string_conversions.h" #include "ios/chrome/browser/infobars/confirm_infobar_controller+protected.h" @@ -19,8 +19,6 @@ } @interface UpdatePasswordInfoBarController ()<SelectorCoordinatorDelegate> { - base::mac::ObjCPropertyReleaser - _propertyReleaser_UpdatePasswordInfoBarController; IOSChromeUpdatePasswordInfoBarDelegate* _delegate; } @property(nonatomic, retain) SelectorCoordinator* selectorCoordinator; @@ -30,13 +28,9 @@ @synthesize selectorCoordinator = _selectorCoordinator; -- (instancetype)initWithDelegate:(InfoBarViewDelegate*)delegate { - self = [super initWithDelegate:delegate]; - if (self) { - _propertyReleaser_UpdatePasswordInfoBarController.Init( - self, [UpdatePasswordInfoBarController class]); - } - return self; +- (void)dealloc { + base::mac::ReleaseProperties(self); + [super dealloc]; } - (InfoBarView*)viewForDelegate:
diff --git a/ios/chrome/browser/snapshots/snapshot_cache.mm b/ios/chrome/browser/snapshots/snapshot_cache.mm index 7fb720d..a2174949 100644 --- a/ios/chrome/browser/snapshots/snapshot_cache.mm +++ b/ios/chrome/browser/snapshots/snapshot_cache.mm
@@ -13,7 +13,7 @@ #include "base/location.h" #include "base/logging.h" #include "base/mac/bind_objc_block.h" -#include "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #include "base/mac/scoped_cftyperef.h" #include "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" @@ -157,8 +157,6 @@ // be requested to be saved to disk when the application is backgrounded. base::scoped_nsobject<NSString> backgroundingImageSessionId_; base::scoped_nsobject<UIImage> backgroundingColorImage_; - - base::mac::ObjCPropertyReleaser propertyReleaser_SnapshotCache_; } @synthesize pinnedIDs = pinnedIDs_; @@ -171,8 +169,6 @@ - (id)init { if ((self = [super init])) { DCHECK_CURRENTLY_ON(web::WebThread::UI); - propertyReleaser_SnapshotCache_.Init(self, [SnapshotCache class]); - if ([self usesLRUCache]) { lruCache_.reset( [[LRUCache alloc] initWithCacheSize:kLRUCacheMaxCapacity]); @@ -212,6 +208,7 @@ removeObserver:self name:UIApplicationDidBecomeActiveNotification object:nil]; + base::mac::ReleaseProperties(self); [super dealloc]; }
diff --git a/ios/chrome/browser/tabs/tab.mm b/ios/chrome/browser/tabs/tab.mm index 56df201..3bbba17 100644 --- a/ios/chrome/browser/tabs/tab.mm +++ b/ios/chrome/browser/tabs/tab.mm
@@ -633,10 +633,15 @@ } - (NSString*)tabId { + if (!self.webState) { + // Tab can outlive WebState, in which case Tab is not valid anymore and + // tabId should be nil. + return nil; + } + if (tabId_) return tabId_; - DCHECK(self.webState); web::SerializableUserDataManager* userDataManager = web::SerializableUserDataManager::FromWebState(self.webState); NSString* tabId = base::mac::ObjCCast<NSString>(
diff --git a/ios/chrome/browser/ui/authentication/authentication_flow.mm b/ios/chrome/browser/ui/authentication/authentication_flow.mm index ca6c1dd..f00b3dc 100644 --- a/ios/chrome/browser/ui/authentication/authentication_flow.mm +++ b/ios/chrome/browser/ui/authentication/authentication_flow.mm
@@ -6,7 +6,7 @@ #include "base/ios/weak_nsobject.h" #include "base/logging.h" -#include "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #include "base/mac/scoped_block.h" #include "base/mac/scoped_nsobject.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h" @@ -101,8 +101,6 @@ // is in progress to ensure it outlives any attempt to destroy it in // |_signInCompletion|. base::scoped_nsobject<AuthenticationFlow> _selfRetainer; - - base::mac::ObjCPropertyReleaser _propertyReleaser_AuthenticationFlow; } @synthesize handlingError = _handlingError; @@ -124,11 +122,15 @@ _postSignInAction = postSignInAction; _presentingViewController.reset([presentingViewController retain]); _state = BEGIN; - _propertyReleaser_AuthenticationFlow.Init(self, [AuthenticationFlow class]); } return self; } +- (void)dealloc { + base::mac::ReleaseProperties(self); + [super dealloc]; +} + - (void)startSignInWithCompletion:(CompletionCallback)completion { DCHECK_EQ(BEGIN, _state); DCHECK(!_signInCompletion);
diff --git a/ios/chrome/browser/ui/elements/activity_overlay_coordinator.mm b/ios/chrome/browser/ui/elements/activity_overlay_coordinator.mm index f56daeec..8ff7dc09 100644 --- a/ios/chrome/browser/ui/elements/activity_overlay_coordinator.mm +++ b/ios/chrome/browser/ui/elements/activity_overlay_coordinator.mm
@@ -4,13 +4,11 @@ #import "ios/chrome/browser/ui/elements/activity_overlay_coordinator.h" -#import "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #import "ios/chrome/browser/ui/elements/activity_overlay_view_controller.h" #import "ios/chrome/browser/ui/uikit_ui_util.h" -@interface ActivityOverlayCoordinator () { - base::mac::ObjCPropertyReleaser _propertyReleaser_ActivityOverlayCoordinator; -} +@interface ActivityOverlayCoordinator () // View controller that displays an activity indicator. @property(nonatomic, retain) UIViewController* activityOverlayViewController; @@ -20,14 +18,9 @@ @synthesize activityOverlayViewController = _activityOverlayViewController; -- (nullable instancetype)initWithBaseViewController: - (UIViewController*)viewController { - self = [super initWithBaseViewController:viewController]; - if (self) { - _propertyReleaser_ActivityOverlayCoordinator.Init( - self, [ActivityOverlayCoordinator class]); - } - return self; +- (void)dealloc { + base::mac::ReleaseProperties(self); + [super dealloc]; } - (void)start {
diff --git a/ios/chrome/browser/ui/main/browser_view_wrangler.mm b/ios/chrome/browser/ui/main/browser_view_wrangler.mm index ef7f08f..1ea694b 100644 --- a/ios/chrome/browser/ui/main/browser_view_wrangler.mm +++ b/ios/chrome/browser/ui/main/browser_view_wrangler.mm
@@ -4,7 +4,7 @@ #import "ios/chrome/browser/ui/main/browser_view_wrangler.h" -#include "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "ios/chrome/browser/application_context.h" @@ -27,8 +27,6 @@ @interface BrowserViewWrangler ()<TabModelObserver> { ios::ChromeBrowserState* _browserState; __unsafe_unretained id<TabModelObserver> _tabModelObserver; - - base::mac::ObjCPropertyReleaser _propertyReleaser_BrowserViewWrangler; } // Responsible for maintaining all state related to sharing to other devices. @@ -68,8 +66,6 @@ - (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState tabModelObserver:(id<TabModelObserver>)tabModelObserver { if ((self = [super init])) { - _propertyReleaser_BrowserViewWrangler.Init(self, - [BrowserViewWrangler class]); _browserState = browserState; _tabModelObserver = tabModelObserver; } @@ -101,6 +97,7 @@ [_mainTabModel browserStateDestroyed]; [_otrTabModel browserStateDestroyed]; + base::mac::ReleaseProperties(self); [super dealloc]; }
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_bar.mm b/ios/chrome/browser/ui/ntp/new_tab_page_bar.mm index 760902a..5cedf9c 100644 --- a/ios/chrome/browser/ui/ntp/new_tab_page_bar.mm +++ b/ios/chrome/browser/ui/ntp/new_tab_page_bar.mm
@@ -8,7 +8,7 @@ #include <cmath> #include "base/logging.h" -#include "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #include "base/mac/scoped_nsobject.h" #import "ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.h" #import "ios/chrome/browser/ui/ntp/new_tab_page_bar_button.h" @@ -66,8 +66,6 @@ CGFloat buttonWidth_; // Percentage overlay sits over tab bar buttons. CGFloat overlayPercentage_; - - base::mac::ObjCPropertyReleaser propertyReleaser_NewTabPageBar_; } @synthesize items = items_; @@ -94,7 +92,6 @@ } - (void)setup { - propertyReleaser_NewTabPageBar_.Init(self, [NewTabPageBar class]); self.selectedIndex = NSNotFound; canAnimate_ = NO; self.autoresizingMask = @@ -133,6 +130,11 @@ self.contentMode = UIViewContentModeRedraw; } +- (void)dealloc { + base::mac::ReleaseProperties(self); + [super dealloc]; +} + - (void)layoutSubviews { [super layoutSubviews];
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_bar_button.mm b/ios/chrome/browser/ui/ntp/new_tab_page_bar_button.mm index 91580eee..658f4256 100644 --- a/ios/chrome/browser/ui/ntp/new_tab_page_bar_button.mm +++ b/ios/chrome/browser/ui/ntp/new_tab_page_bar_button.mm
@@ -5,7 +5,7 @@ #import "ios/chrome/browser/ui/ntp/new_tab_page_bar_button.h" #include "base/logging.h" -#include "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #import "ios/chrome/browser/ui/ntp/new_tab_page_bar_item.h" #import "ios/chrome/browser/ui/uikit_ui_util.h" #import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" @@ -27,7 +27,6 @@ UIImage* _image; NSString* _title; - base::mac::ObjCPropertyReleaser _propertyReleaser_NewTabPageBarButton; } @property(nonatomic, retain) UIColor* color; @@ -62,8 +61,6 @@ DCHECK(item.image); NewTabPageBarButton* button = [[self class] buttonWithType:UIButtonTypeCustom]; - button->_propertyReleaser_NewTabPageBarButton.Init( - button, [NewTabPageBarButton class]); button.title = item.title; button.image = @@ -85,6 +82,11 @@ return button; } +- (void)dealloc { + base::mac::ReleaseProperties(self); + [super dealloc]; +} + - (void)useIncognitoColorScheme:(CGFloat)percentage { DCHECK(percentage >= 0 && percentage <= 1); self.interpolatedColor =
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_bar_item.mm b/ios/chrome/browser/ui/ntp/new_tab_page_bar_item.mm index 915497f3..90075680 100644 --- a/ios/chrome/browser/ui/ntp/new_tab_page_bar_item.mm +++ b/ios/chrome/browser/ui/ntp/new_tab_page_bar_item.mm
@@ -4,7 +4,7 @@ #import "ios/chrome/browser/ui/ntp/new_tab_page_bar_item.h" -#include "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" @implementation NewTabPageBarItem { // Title of the button. @@ -15,7 +15,6 @@ UIImage* image_; // New tab page view. __unsafe_unretained UIView* view_; // weak - base::mac::ObjCPropertyReleaser propertyReleaser_NewTabPageBarItem_; } @synthesize title = title_; @@ -35,12 +34,9 @@ return item; } -- (id)init { - self = [super init]; - if (self) { - propertyReleaser_NewTabPageBarItem_.Init(self, [NewTabPageBarItem class]); - } - return self; +- (void)dealloc { + base::mac::ReleaseProperties(self); + [super dealloc]; } @end
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_controller.mm b/ios/chrome/browser/ui/ntp/new_tab_page_controller.mm index 60b9af7..43818934 100644 --- a/ios/chrome/browser/ui/ntp/new_tab_page_controller.mm +++ b/ios/chrome/browser/ui/ntp/new_tab_page_controller.mm
@@ -8,7 +8,7 @@ #import "base/ios/weak_nsobject.h" #include "base/logging.h" -#include "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics_action.h" #include "components/prefs/pref_service.h" @@ -131,8 +131,6 @@ base::WeakNSProtocol<id<WebToolbarDelegate>> webToolbarDelegate_; base::scoped_nsobject<TabModel> tabModel_; - - base::mac::ObjCPropertyReleaser propertyReleaser_NewTabPageController_; } // Load and bring panel into view. @@ -198,8 +196,6 @@ self = [super initWithNibName:nil url:url]; if (self) { DCHECK(browserState); - propertyReleaser_NewTabPageController_.Init(self, - [NewTabPageController class]); browserState_ = browserState; loader_ = loader; newTabPageObserver_ = ntpObserver; @@ -317,6 +313,7 @@ [bookmarkController_ setDelegate:nil]; [openTabsController_ setDelegate:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self]; + base::mac::ReleaseProperties(self); [super dealloc]; }
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_view.mm b/ios/chrome/browser/ui/ntp/new_tab_page_view.mm index 5245ee5..95996a5 100644 --- a/ios/chrome/browser/ui/ntp/new_tab_page_view.mm +++ b/ios/chrome/browser/ui/ntp/new_tab_page_view.mm
@@ -5,7 +5,7 @@ #import "ios/chrome/browser/ui/ntp/new_tab_page_view.h" #include "base/logging.h" -#include "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #import "ios/chrome/browser/ui/ntp/new_tab_page_bar.h" #import "ios/chrome/browser/ui/ntp/new_tab_page_bar_item.h" #import "ios/chrome/browser/ui/rtl_geometry.h" @@ -17,8 +17,6 @@ // subviews already. __unsafe_unretained NewTabPageBar* tabBar_; // weak __unsafe_unretained UIScrollView* scrollView_; // weak - - base::mac::ObjCPropertyReleaser propertyReleaser_NewTabPageView_; } @synthesize scrollView = scrollView_; @@ -29,7 +27,6 @@ andTabBar:(NewTabPageBar*)tabBar { self = [super initWithFrame:frame]; if (self) { - propertyReleaser_NewTabPageView_.Init(self, [NewTabPageView class]); [self addSubview:scrollView]; [self addSubview:tabBar]; scrollView_ = scrollView; @@ -48,6 +45,11 @@ return nil; } +- (void)dealloc { + base::mac::ReleaseProperties(self); + [super dealloc]; +} + - (void)setFrame:(CGRect)frame { // When transitioning the iPhone xib to an iPad idiom, the setFrame call below // can sometimes fire a scrollViewDidScroll event which changes the
diff --git a/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm b/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm index b1049d4..5d26414f 100644 --- a/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm +++ b/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm
@@ -8,7 +8,7 @@ #include <algorithm> #include "base/logging.h" -#include "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #include "base/mac/scoped_nsobject.h" #include "base/metrics/histogram_macros.h" #import "ios/chrome/browser/ui/browser_view_controller.h" @@ -168,7 +168,6 @@ // The scrollview driving the OverscrollActionsController when not using // the scrollview from the CRWWebControllerObserver. base::scoped_nsobject<UIScrollView> _scrollview; - base::mac::ObjCPropertyReleaser _propertyReleaser_OverscrollActionsController; } // The view displayed over the header view holding the actions. @@ -246,8 +245,6 @@ - (instancetype)initWithScrollView:(UIScrollView*)scrollView { self = [super init]; if (self) { - _propertyReleaser_OverscrollActionsController.Init( - self, [OverscrollActionsController class]); _overscrollActionView = [[OverscrollActionsView alloc] initWithFrame:CGRectZero]; _overscrollActionView.delegate = self; @@ -280,6 +277,7 @@ - (void)dealloc { self.overscrollActionView.delegate = nil; [self invalidate]; + base::mac::ReleaseProperties(self); [super dealloc]; }
diff --git a/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.mm b/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.mm index 9e2768c..4333cdb 100644 --- a/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.mm +++ b/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.mm
@@ -7,7 +7,7 @@ #import <QuartzCore/QuartzCore.h> #include "base/logging.h" -#include "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #include "base/mac/scoped_nsobject.h" #include "ios/chrome/browser/ui/rtl_geometry.h" #include "ios/chrome/browser/ui/uikit_ui_util.h" @@ -134,7 +134,6 @@ // The array is built the first time the method -layersToCenterVertically is // called. base::scoped_nsobject<NSArray> _layersToCenterVertically; - base::mac::ObjCPropertyReleaser _propertyReleaser_OverscrollActionsView; } // Redefined to readwrite. @@ -242,8 +241,6 @@ - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { - _propertyReleaser_OverscrollActionsView.Init(self, - [OverscrollActionsView class]); _deformationBehaviorEnabled = YES; self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; @@ -305,6 +302,7 @@ - (void)dealloc { [self.snapshotView removeFromSuperview]; + base::mac::ReleaseProperties(self); [super dealloc]; }
diff --git a/ios/chrome/browser/ui/popup_menu/popup_menu_controller.mm b/ios/chrome/browser/ui/popup_menu/popup_menu_controller.mm index 6784433..5d528dfa 100644 --- a/ios/chrome/browser/ui/popup_menu/popup_menu_controller.mm +++ b/ios/chrome/browser/ui/popup_menu/popup_menu_controller.mm
@@ -7,7 +7,7 @@ #import "base/ios/weak_nsobject.h" #include "base/logging.h" #include "base/mac/bundle_locations.h" -#include "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #import "ios/chrome/browser/ui/animation_util.h" #import "ios/chrome/browser/ui/popup_menu/popup_menu_view.h" #include "ios/chrome/browser/ui/rtl_geometry.h" @@ -55,7 +55,6 @@ } // anonymous namespace @interface PopupMenuController ()<PopupMenuViewDelegate> { - base::mac::ObjCPropertyReleaser propertyReleaser_PopupMenuController_; CGPoint sourceAnimationPoint_; } @end @@ -85,9 +84,6 @@ DCHECK(parent); self = [super init]; if (self) { - propertyReleaser_PopupMenuController_.Init(self, - [PopupMenuController class]); - popupContainer_ = [[PopupMenuView alloc] initWithFrame:CGRectMake(0, 0, kPopupContainerWidth, kPopupContainerHeight)]; @@ -176,6 +172,7 @@ [popupContainer_ removeFromSuperview]; [backgroundButton_ removeFromSuperview]; [containerView_ removeFromSuperview]; + base::mac::ReleaseProperties(self); [super dealloc]; }
diff --git a/ios/chrome/browser/ui/settings/save_passwords_collection_view_controller.mm b/ios/chrome/browser/ui/settings/save_passwords_collection_view_controller.mm index 742b1c7..5475996 100644 --- a/ios/chrome/browser/ui/settings/save_passwords_collection_view_controller.mm +++ b/ios/chrome/browser/ui/settings/save_passwords_collection_view_controller.mm
@@ -11,7 +11,7 @@ #import "base/ios/weak_nsobject.h" #include "base/logging.h" #include "base/mac/foundation_util.h" -#import "base/mac/objc_property_releaser.h" +#import "base/mac/objc_release_properties.h" #import "base/mac/scoped_nsobject.h" #include "base/memory/ptr_util.h" #include "base/numerics/safe_conversions.h" @@ -162,9 +162,6 @@ // Module containing the reauthentication mechanism for viewing and copying // passwords. base::scoped_nsobject<ReauthenticationModule> reauthenticationModule_; - - base::mac::ObjCPropertyReleaser - propertyReleaser_SavePasswordsCollectionViewController_; } // Kick off async request to get logins from password store. - (void)getLoginsFromPasswordStore; @@ -194,15 +191,13 @@ [self getLoginsFromPasswordStore]; [self updateEditButton]; [self loadModel]; - - propertyReleaser_SavePasswordsCollectionViewController_.Init( - self, [SavePasswordsCollectionViewController class]); } return self; } - (void)dealloc { [passwordManagerEnabled_ setObserver:nil]; + base::mac::ReleaseProperties(self); [super dealloc]; }
diff --git a/ios/chrome/browser/ui/settings/settings_root_collection_view_controller.mm b/ios/chrome/browser/ui/settings/settings_root_collection_view_controller.mm index d259ef5..adbdd0a 100644 --- a/ios/chrome/browser/ui/settings/settings_root_collection_view_controller.mm +++ b/ios/chrome/browser/ui/settings/settings_root_collection_view_controller.mm
@@ -7,7 +7,7 @@ #include "base/ios/ios_util.h" #include "base/logging.h" #import "base/mac/foundation_util.h" -#import "base/mac/objc_property_releaser.h" +#import "base/mac/objc_release_properties.h" #import "base/mac/scoped_nsobject.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h" #import "ios/chrome/browser/ui/commands/UIKit+ChromeExecuteCommand.h" @@ -39,22 +39,15 @@ SavedBarButtomItemPositionEnum savedBarButtonItemPosition_; base::scoped_nsobject<UIBarButtonItem> savedBarButtonItem_; base::scoped_nsobject<UIView> veil_; - - base::mac::ObjCPropertyReleaser - propertyReleaser_SettingsRootCollectionViewController_; } @synthesize shouldHideDoneButton = shouldHideDoneButton_; @synthesize collectionViewAccessibilityIdentifier = collectionViewAccessibilityIdentifier_; -- (instancetype)initWithStyle:(CollectionViewControllerStyle)style { - self = [super initWithStyle:style]; - if (self) { - propertyReleaser_SettingsRootCollectionViewController_.Init( - self, [SettingsRootCollectionViewController class]); - } - return self; +- (void)dealloc { + base::mac::ReleaseProperties(self); + [super dealloc]; } - (void)viewDidLoad {
diff --git a/ios/chrome/browser/ui/settings/sync_encryption_passphrase_collection_view_controller.mm b/ios/chrome/browser/ui/settings/sync_encryption_passphrase_collection_view_controller.mm index 2ccd5b3..9744b78 100644 --- a/ios/chrome/browser/ui/settings/sync_encryption_passphrase_collection_view_controller.mm +++ b/ios/chrome/browser/ui/settings/sync_encryption_passphrase_collection_view_controller.mm
@@ -8,7 +8,7 @@ #include "base/i18n/time_formatting.h" #include "base/mac/foundation_util.h" -#import "base/mac/objc_property_releaser.h" +#import "base/mac/objc_release_properties.h" #import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "components/browser_sync/profile_sync_service.h" @@ -65,8 +65,6 @@ std::unique_ptr<SyncObserverBridge> syncObserver_; std::unique_ptr<OAuth2TokenServiceObserverBridge> tokenServiceObserver_; base::scoped_nsobject<UITextField> passphrase_; - base::mac::ObjCPropertyReleaser - propertyReleaser_SyncEncryptionPassphraseCollectionViewController_; } // Sets up the navigation bar's right button. The button will be enabled iff @@ -142,14 +140,16 @@ tokenServiceObserver_.reset(new OAuth2TokenServiceObserverBridge( OAuth2TokenServiceFactory::GetForBrowserState(browserState_), self)); - propertyReleaser_SyncEncryptionPassphraseCollectionViewController_.Init( - self, [SyncEncryptionPassphraseCollectionViewController class]); - [self loadModel]; } return self; } +- (void)dealloc { + base::mac::ReleaseProperties(self); + [super dealloc]; +} + - (UITextField*)passphrase { return passphrase_; }
diff --git a/ios/chrome/browser/ui/stack_view/card_view.mm b/ios/chrome/browser/ui/stack_view/card_view.mm index 0ca24d4..62a810a 100644 --- a/ios/chrome/browser/ui/stack_view/card_view.mm +++ b/ios/chrome/browser/ui/stack_view/card_view.mm
@@ -26,7 +26,7 @@ #include <algorithm> #import "base/mac/foundation_util.h" -#import "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #import "base/mac/scoped_nsobject.h" #include "components/strings/grit/components_strings.h" #import "ios/chrome/browser/ui/animation_util.h" @@ -124,9 +124,7 @@ @end -@implementation CardTabView { - base::mac::ObjCPropertyReleaser _propertyReleaser_CardTabView; -} +@implementation CardTabView #pragma mark - Property Implementation @@ -146,7 +144,6 @@ if (!self) return self; - _propertyReleaser_CardTabView.Init(self, [CardTabView class]); _isIncognito = isIncognito; UIImage* image = ImageWithName(@"default_favicon", _isIncognito); @@ -178,6 +175,11 @@ return nil; } +- (void)dealloc { + base::mac::ReleaseProperties(self); + [super dealloc]; +} + - (void)setCloseButtonSide:(CardCloseButtonSide)closeButtonSide { if (_closeButtonSide != closeButtonSide) { _closeButtonSide = closeButtonSide;
diff --git a/ios/chrome/browser/ui/stack_view/stack_view_controller.mm b/ios/chrome/browser/ui/stack_view/stack_view_controller.mm index cdb4ba2b..d17b5d6 100644 --- a/ios/chrome/browser/ui/stack_view/stack_view_controller.mm +++ b/ios/chrome/browser/ui/stack_view/stack_view_controller.mm
@@ -16,7 +16,7 @@ #include "base/logging.h" #import "base/mac/bundle_locations.h" #import "base/mac/foundation_util.h" -#import "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #include "base/mac/scoped_block.h" #import "base/mac/scoped_nsobject.h" #include "base/metrics/histogram_macros.h" @@ -489,8 +489,6 @@ // |YES| if there is card set animation being processed. For testing only. // Save last touch point used by new tab animation. CGPoint _lastTapPoint; - - base::mac::ObjCPropertyReleaser _propertyReleaserStackViewController; } @synthesize activeCardSet = _activeCardSet; @@ -513,8 +511,6 @@ DCHECK(activeCardSet == otrCardSet || activeCardSet == mainCardSet); self = [super initWithNibName:nil bundle:nil]; if (self) { - _propertyReleaserStackViewController.Init(self, - [StackViewController class]); [self setUpWithMainCardSet:mainCardSet otrCardSet:otrCardSet activeCardSet:activeCardSet]; @@ -816,6 +812,7 @@ [_mainCardSet setObserver:nil]; [_otrCardSet setObserver:nil]; [self cleanUpViewsAndNotifications]; + base::mac::ReleaseProperties(self); [super dealloc]; }
diff --git a/ios/chrome/browser/ui/tabs/tab_strip_controller.mm b/ios/chrome/browser/ui/tabs/tab_strip_controller.mm index c09b68a3..7f3f0c4 100644 --- a/ios/chrome/browser/ui/tabs/tab_strip_controller.mm +++ b/ios/chrome/browser/ui/tabs/tab_strip_controller.mm
@@ -12,7 +12,7 @@ #import "base/ios/weak_nsobject.h" #include "base/mac/bundle_locations.h" #include "base/mac/foundation_util.h" -#include "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #include "base/mac/scoped_nsobject.h" #include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics_action.h" @@ -183,8 +183,6 @@ // The model index of the placeholder gap, if one exists. This value is used // as the new model index of the dragged tab when it is dropped. NSUInteger _placeholderGapModelIndex; - - base::mac::ObjCPropertyReleaser _propertyReleaser_TabStripController; } @property(nonatomic, readonly, retain) TabStripView* tabStripView; @@ -326,7 +324,6 @@ - (instancetype)initWithTabModel:(TabModel*)tabModel style:(TabStrip::Style)style { if ((self = [super init])) { - _propertyReleaser_TabStripController.Init(self, [TabStripController class]); _tabArray.reset([[NSMutableArray alloc] initWithCapacity:10]); _closingTabs.reset([[NSMutableSet alloc] initWithCapacity:5]); @@ -432,6 +429,7 @@ [_tabStripView setDelegate:nil]; [_tabStripView setLayoutDelegate:nil]; [_tabModel removeObserver:self]; + base::mac::ReleaseProperties(self); [super dealloc]; }
diff --git a/ios/chrome/browser/ui/tabs/tab_view.mm b/ios/chrome/browser/ui/tabs/tab_view.mm index cbc9b10..00a5502 100644 --- a/ios/chrome/browser/ui/tabs/tab_view.mm +++ b/ios/chrome/browser/ui/tabs/tab_view.mm
@@ -8,7 +8,7 @@ #include "base/i18n/rtl.h" #include "base/ios/ios_util.h" #include "base/logging.h" -#include "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #include "base/strings/sys_string_conversions.h" #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" #import "ios/chrome/browser/ui/commands/UIKit+ChromeExecuteCommand.h" @@ -72,8 +72,6 @@ BOOL _collapsed; base::scoped_nsobject<MDCActivityIndicator> _activityIndicator; - - base::mac::ObjCPropertyReleaser _propertyReleaser_TabView; } @end @@ -115,7 +113,6 @@ - (id)initWithEmptyView:(BOOL)emptyView selected:(BOOL)selected { if ((self = [super initWithFrame:CGRectZero])) { - _propertyReleaser_TabView.Init(self, [TabView class]); [self setOpaque:NO]; [self createCommonViews]; // -setSelected only calls -updateBackgroundImage if the selected state @@ -130,6 +127,11 @@ return self; } +- (void)dealloc { + base::mac::ReleaseProperties(self); + [super dealloc]; +} + - (void)setSelected:(BOOL)selected { BOOL wasSelected = [self isSelected]; [super setSelected:selected];
diff --git a/ios/chrome/browser/ui/tools_menu/tools_menu_view_controller.mm b/ios/chrome/browser/ui/tools_menu/tools_menu_view_controller.mm index e6bd954..36f9c5f 100644 --- a/ios/chrome/browser/ui/tools_menu/tools_menu_view_controller.mm +++ b/ios/chrome/browser/ui/tools_menu/tools_menu_view_controller.mm
@@ -9,7 +9,7 @@ #include "base/ios/ios_util.h" #import "base/ios/weak_nsobject.h" #include "base/logging.h" -#include "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #include "base/mac/scoped_nsobject.h" #include "base/metrics/field_trial.h" #include "components/strings/grit/components_strings.h" @@ -105,7 +105,6 @@ @interface ToolsMenuViewController ()<UICollectionViewDelegateFlowLayout, UICollectionViewDataSource, ReadingListMenuNotificationDelegate> { - base::mac::ObjCPropertyReleaser _propertyReleaser_ToolsMenuViewController; BOOL _waitForInk; // Weak pointer to ReadingListMenuNotifier, used to set the starting values // for the reading list badge. @@ -336,11 +335,14 @@ } - (void)commonInitialization { - _propertyReleaser_ToolsMenuViewController.Init( - self, [ToolsMenuViewController class]); _readingListMenuNotifier.reset(); } +- (void)dealloc { + base::mac::ReleaseProperties(self); + [super dealloc]; +} + - (void)loadView { [super loadView];
diff --git a/ios/chrome/browser/ui/tools_menu/tools_menu_view_item.mm b/ios/chrome/browser/ui/tools_menu/tools_menu_view_item.mm index 9db0a61..182983a 100644 --- a/ios/chrome/browser/ui/tools_menu/tools_menu_view_item.mm +++ b/ios/chrome/browser/ui/tools_menu/tools_menu_view_item.mm
@@ -5,7 +5,7 @@ #import "ios/chrome/browser/ui/tools_menu/tools_menu_view_item.h" #include "base/i18n/rtl.h" -#include "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoFontLoader.h" #include "ui/base/l10n/l10n_util.h" @@ -16,9 +16,7 @@ static NSString* const kMenuItemCellID = @"MenuItemCellID"; } -@implementation ToolsMenuViewItem { - base::mac::ObjCPropertyReleaser _propertyReleaser_ToolsMenuViewItem; -} +@implementation ToolsMenuViewItem @synthesize accessibilityIdentifier = _accessibilityIdentifier; @synthesize active = _active; @@ -29,13 +27,17 @@ - (id)init { self = [super init]; if (self) { - _propertyReleaser_ToolsMenuViewItem.Init(self, [ToolsMenuViewItem class]); _active = YES; } return self; } +- (void)dealloc { + base::mac::ReleaseProperties(self); + [super dealloc]; +} + + (NSString*)cellID { return kMenuItemCellID; } @@ -58,9 +60,7 @@ @end -@implementation ToolsMenuViewCell { - base::mac::ObjCPropertyReleaser _propertyReleaser_ToolsMenuViewCell; -} +@implementation ToolsMenuViewCell @synthesize title = _title; @synthesize horizontalMargin = _horizontalMargin; @@ -82,13 +82,17 @@ } - (void)commonInitialization { - _propertyReleaser_ToolsMenuViewCell.Init(self, [ToolsMenuViewCell class]); _horizontalMargin = !base::i18n::IsRTL() ? kToolsMenuItemHorizontalMargin : kToolsMenuItemHorizontalMarginRTL; [self setBackgroundColor:[UIColor whiteColor]]; [self setOpaque:YES]; } +- (void)dealloc { + base::mac::ReleaseProperties(self); + [super dealloc]; +} + - (void)prepareForReuse { [super prepareForReuse]; [_title setText:nil];
diff --git a/ios/chrome/browser/ui/tools_menu/tools_menu_view_tools_cell.mm b/ios/chrome/browser/ui/tools_menu/tools_menu_view_tools_cell.mm index e5c3b10..da5cc4a 100644 --- a/ios/chrome/browser/ui/tools_menu/tools_menu_view_tools_cell.mm +++ b/ios/chrome/browser/ui/tools_menu/tools_menu_view_tools_cell.mm
@@ -4,7 +4,7 @@ #import "ios/chrome/browser/ui/tools_menu/tools_menu_view_tools_cell.h" -#include "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #include "components/strings/grit/components_strings.h" #include "ios/chrome/browser/ui/commands/ios_command_ids.h" #include "ios/chrome/browser/ui/rtl_geometry.h" @@ -18,9 +18,7 @@ // IDC_MinimumLabelValue) to avoid collisions. #define IDC_TEMP_EDIT_BOOKMARK 3900 -@implementation ToolsMenuViewToolsCell { - base::mac::ObjCPropertyReleaser _propertyReleaser_ToolsMenuViewToolsCell; -} +@implementation ToolsMenuViewToolsCell @synthesize reloadButton = _reloadButton; @synthesize shareButton = _shareButton; @@ -46,9 +44,6 @@ } - (void)commonInitialization { - _propertyReleaser_ToolsMenuViewToolsCell.Init(self, - [ToolsMenuViewToolsCell class]); - [self setBackgroundColor:[UIColor whiteColor]]; [self setOpaque:YES]; @@ -102,6 +97,11 @@ [self addConstraints]; } +- (void)dealloc { + base::mac::ReleaseProperties(self); + [super dealloc]; +} + - (UIButton*)newButtonForImageIds:(int[2][3])imageIds commandID:(int)commandID accessibilityLabelID:(int)labelID
diff --git a/ios/web/public/origin_util_unittest.mm b/ios/web/public/origin_util_unittest.mm index 79cae2b0..723ebf7 100644 --- a/ios/web/public/origin_util_unittest.mm +++ b/ios/web/public/origin_util_unittest.mm
@@ -6,7 +6,7 @@ #import <WebKit/WebKit.h> -#import "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #import "base/mac/scoped_nsobject.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" @@ -19,17 +19,13 @@ @property(nonatomic) NSInteger port; @end -@implementation WKSecurityOriginStub { - base::mac::ObjCPropertyReleaser _propertyReleaser; -} +@implementation WKSecurityOriginStub @synthesize protocol = _protocol; @synthesize host = _host; @synthesize port = _port; -- (instancetype)init { - if (self = [super init]) { - _propertyReleaser.Init(self, [WKSecurityOriginStub class]); - } - return self; +- (void)dealloc { + base::mac::ReleaseProperties(self); + [super dealloc]; } @end
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm index ef9d4bd..1322901 100644 --- a/ios/web/web_state/ui/crw_web_controller.mm +++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -25,7 +25,7 @@ #import "base/mac/bind_objc_block.h" #include "base/mac/bundle_locations.h" #include "base/mac/foundation_util.h" -#import "base/mac/objc_property_releaser.h" +#include "base/mac/objc_release_properties.h" #include "base/mac/scoped_cftyperef.h" #import "base/mac/scoped_nsobject.h" #include "base/memory/ptr_util.h" @@ -216,10 +216,7 @@ // A container object for any navigation information that is only available // during pre-commit delegate callbacks, and thus must be held until the // navigation commits and the informatino can be used. -@interface CRWWebControllerPendingNavigationInfo : NSObject { - base::mac::ObjCPropertyReleaser - _propertyReleaser_CRWWebControllerPendingNavigationInfo; -} +@interface CRWWebControllerPendingNavigationInfo : NSObject // The referrer for the page. @property(nonatomic, copy) NSString* referrer; // The MIME type for the page. @@ -244,12 +241,16 @@ - (instancetype)init { if ((self = [super init])) { - _propertyReleaser_CRWWebControllerPendingNavigationInfo.Init( - self, [CRWWebControllerPendingNavigationInfo class]); _navigationType = WKNavigationTypeOther; } return self; } + +- (void)dealloc { + base::mac::ReleaseProperties(self); + [super dealloc]; +} + @end @interface CRWWebController ()<CRWContextMenuDelegate, @@ -848,9 +849,6 @@ // Handles 'console' message. - (BOOL)handleConsoleMessage:(base::DictionaryValue*)message context:(NSDictionary*)context; -// Handles 'geolocationDialog.suppressed' message. -- (BOOL)handleGeolocationDialogSuppressedMessage:(base::DictionaryValue*)message - context:(NSDictionary*)context; // Handles 'document.favicons' message. - (BOOL)handleDocumentFaviconsMessage:(base::DictionaryValue*)message context:(NSDictionary*)context; @@ -2387,8 +2385,6 @@ @selector(handleAddPluginPlaceholdersMessage:context:); (*handlers)["chrome.send"] = @selector(handleChromeSendMessage:context:); (*handlers)["console"] = @selector(handleConsoleMessage:context:); - (*handlers)["geolocationDialog.suppressed"] = - @selector(handleGeolocationDialogSuppressedMessage:context:); (*handlers)["document.favicons"] = @selector(handleDocumentFaviconsMessage:context:); (*handlers)["document.submit"] = @@ -2530,12 +2526,6 @@ return YES; } -- (BOOL)handleGeolocationDialogSuppressedMessage:(base::DictionaryValue*)message - context:(NSDictionary*)context { - _webStateImpl->OnDialogSuppressed(); - return YES; -} - - (BOOL)handleDocumentFaviconsMessage:(base::DictionaryValue*)message context:(NSDictionary*)context { base::ListValue* favicons = nullptr;
diff --git a/net/disk_cache/entry_unittest.cc b/net/disk_cache/entry_unittest.cc index 85dd85a3..55f9cf9 100644 --- a/net/disk_cache/entry_unittest.cc +++ b/net/disk_cache/entry_unittest.cc
@@ -20,6 +20,7 @@ #include "net/base/test_completion_callback.h" #include "net/disk_cache/blockfile/backend_impl.h" #include "net/disk_cache/blockfile/entry_impl.h" +#include "net/disk_cache/cache_util.h" #include "net/disk_cache/disk_cache_test_base.h" #include "net/disk_cache/disk_cache_test_util.h" #include "net/disk_cache/memory/mem_entry_impl.h" @@ -4300,3 +4301,24 @@ disk_cache::simple_util::CorruptStream0LengthFromEntry(key, cache_path_)); EXPECT_NE(net::OK, OpenEntry(key, &entry)); } + +TEST_F(DiskCacheEntryTest, SimpleCacheCreateRecoverFromRmdir) { + // This test runs as APP_CACHE to make operations more synchronous. + // (in particular we want to see if create succeeded or not, so we don't + // want an optimistic one). + SetCacheType(net::APP_CACHE); + SetSimpleCacheMode(); + InitCache(); + + // Pretend someone deleted the cache dir. This shouldn't be too scary in + // the test since cache_path_ is set as: + // CHECK(temp_dir_.CreateUniqueTempDir()); + // cache_path_ = temp_dir_.GetPath(); + disk_cache::DeleteCache(cache_path_, + true /* delete the dir, what we really want*/); + + disk_cache::Entry* entry; + std::string key("a key"); + ASSERT_THAT(CreateEntry(key, &entry), IsOk()); + entry->Close(); +}
diff --git a/net/disk_cache/simple/simple_synchronous_entry.cc b/net/disk_cache/simple/simple_synchronous_entry.cc index ea83472..2b4673c2 100644 --- a/net/disk_cache/simple/simple_synchronous_entry.cc +++ b/net/disk_cache/simple/simple_synchronous_entry.cc
@@ -868,8 +868,19 @@ int flags = File::FLAG_CREATE | File::FLAG_READ | File::FLAG_WRITE | File::FLAG_SHARE_DELETE; files_[file_index].Initialize(filename, flags); - *out_error = files_[file_index].error_details(); + // It's possible that the creation failed because someone deleted the + // directory (e.g. because someone pressed "clear cache" on Android). + // If so, we would keep failing for a while until periodic index snapshot + // re-creates the cache dir, so try to recover from it quickly here. + if (!files_[file_index].IsValid() && + files_[file_index].error_details() == File::FILE_ERROR_NOT_FOUND && + !base::DirectoryExists(path_)) { + if (base::CreateDirectory(path_)) + files_[file_index].Initialize(filename, flags); + } + + *out_error = files_[file_index].error_details(); empty_file_omitted_[file_index] = false; return files_[file_index].IsValid();
diff --git a/services/catalog/instance.cc b/services/catalog/instance.cc index d6f81c8..844ec82 100644 --- a/services/catalog/instance.cc +++ b/services/catalog/instance.cc
@@ -78,7 +78,7 @@ } void Instance::GetEntries(const base::Optional<std::vector<std::string>>& names, - const GetEntriesCallback& callback) { + GetEntriesCallback callback) { DCHECK(system_cache_); std::vector<mojom::EntryPtr> entries; @@ -94,17 +94,17 @@ AddEntry(*entry, &entries); } } - callback.Run(std::move(entries)); + std::move(callback).Run(std::move(entries)); } void Instance::GetEntriesProvidingCapability( const std::string& capability, - const GetEntriesProvidingCapabilityCallback& callback) { + GetEntriesProvidingCapabilityCallback callback) { std::vector<mojom::EntryPtr> entries; for (const auto& entry : system_cache_->entries()) if (entry.second->ProvidesCapability(capability)) entries.push_back(mojom::Entry::From(*entry.second)); - callback.Run(std::move(entries)); + std::move(callback).Run(std::move(entries)); } } // namespace catalog
diff --git a/services/catalog/instance.h b/services/catalog/instance.h index 1e437ea..a2cbebe 100644 --- a/services/catalog/instance.h +++ b/services/catalog/instance.h
@@ -38,10 +38,10 @@ // mojom::Catalog: void GetEntries(const base::Optional<std::vector<std::string>>& names, - const GetEntriesCallback& callback) override; + GetEntriesCallback callback) override; void GetEntriesProvidingCapability( const std::string& capability, - const GetEntriesProvidingCapabilityCallback& callback) override; + GetEntriesProvidingCapabilityCallback callback) override; mojo::BindingSet<service_manager::mojom::Resolver> resolver_bindings_; mojo::BindingSet<mojom::Catalog> catalog_bindings_;
diff --git a/services/catalog/public/interfaces/BUILD.gn b/services/catalog/public/interfaces/BUILD.gn index 65396e410..b8ba8cc 100644 --- a/services/catalog/public/interfaces/BUILD.gn +++ b/services/catalog/public/interfaces/BUILD.gn
@@ -13,9 +13,6 @@ ":constants", "//mojo/common:common_custom_types", ] - - # TODO(crbug.com/714018): Convert the implementation to use OnceCallback. - use_once_callback = false } mojom("constants") {
diff --git a/skia/ext/event_tracer_impl.cc b/skia/ext/event_tracer_impl.cc index be92583..82d35a6 100644 --- a/skia/ext/event_tracer_impl.cc +++ b/skia/ext/event_tracer_impl.cc
@@ -73,6 +73,5 @@ void InitSkiaEventTracer() { // Initialize the binding to Skia's tracing events. Skia will // take ownership of and clean up the memory allocated here. - if (!SkEventTracer::GetInstance()) - SkEventTracer::SetInstance(new skia::SkChromiumEventTracer()); + SkEventTracer::SetInstance(new skia::SkChromiumEventTracer()); }
diff --git a/testing/buildbot/chromium.perf.fyi.json b/testing/buildbot/chromium.perf.fyi.json index 87df2d24..55e51d4 100644 --- a/testing/buildbot/chromium.perf.fyi.json +++ b/testing/buildbot/chromium.perf.fyi.json
@@ -5639,65 +5639,6 @@ }, { "args": [ - "v8.key_mobile_sites_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=android-chromium" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.key_mobile_sites_smooth", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build249-m4--device5", - "os": "Android", - "pool": "Chrome-perf-fyi" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.key_mobile_sites_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.key_mobile_sites_smooth.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build249-m4--device5", - "os": "Android", - "pool": "Chrome-perf-fyi" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "v8.mobile_infinite_scroll-classic_tbmv2", "-v", "--upload-results", @@ -5934,65 +5875,6 @@ }, { "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=android-chromium" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build249-m4--device3", - "os": "Android", - "pool": "Chrome-perf-fyi" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build249-m4--device3", - "os": "Android", - "pool": "Chrome-perf-fyi" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "webrtc.datachannel", "-v", "--upload-results", @@ -12223,65 +12105,6 @@ }, { "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release_x64" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:22b1", - "id": "build151-b1", - "os": "Windows-10-10586", - "pool": "Chrome-perf-fyi" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:22b1", - "id": "build151-b1", - "os": "Windows-10-10586", - "pool": "Chrome-perf-fyi" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "webrtc.datachannel", "-v", "--upload-results", @@ -18451,65 +18274,6 @@ }, { "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release_x64" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "1002:9874", - "id": "build215-b4", - "os": "Windows-10-10586", - "pool": "Chrome-perf-fyi" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "1002:9874", - "id": "build215-b4", - "os": "Windows-10-10586", - "pool": "Chrome-perf-fyi" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "webrtc.datachannel", "-v", "--upload-results",
diff --git a/testing/buildbot/chromium.perf.json b/testing/buildbot/chromium.perf.json index 0d4b4c56..1a92083 100644 --- a/testing/buildbot/chromium.perf.json +++ b/testing/buildbot/chromium.perf.json
@@ -5706,65 +5706,6 @@ }, { "args": [ - "v8.key_mobile_sites_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=android-chromium" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.key_mobile_sites_smooth", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build75-b1--device5", - "os": "Android", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.key_mobile_sites_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.key_mobile_sites_smooth.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build75-b1--device5", - "os": "Android", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "v8.mobile_infinite_scroll-classic_tbmv2", "-v", "--upload-results", @@ -6001,65 +5942,6 @@ }, { "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=android-chromium" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build75-b1--device3", - "os": "Android", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build75-b1--device3", - "os": "Android", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "webrtc.datachannel", "-v", "--upload-results", @@ -12250,65 +12132,6 @@ }, { "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build152-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build152-m1", - "os": "Ubuntu-14.04", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "webrtc.datachannel", "-v", "--upload-results", @@ -18498,65 +18321,6 @@ }, { "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:0166", - "id": "build106-b1", - "os": "Mac-10.11", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:0166", - "id": "build106-b1", - "os": "Mac-10.11", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "webrtc.datachannel", "-v", "--upload-results", @@ -24726,65 +24490,6 @@ }, { "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:0a2e", - "id": "build162-m1", - "os": "Mac-10.12", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:0a2e", - "id": "build162-m1", - "os": "Mac-10.12", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "webrtc.datachannel", "-v", "--upload-results", @@ -30974,65 +30679,6 @@ }, { "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:1626", - "id": "build127-b1", - "os": "Mac-10.11", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:1626", - "id": "build127-b1", - "os": "Mac-10.11", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "webrtc.datachannel", "-v", "--upload-results", @@ -37202,65 +36848,6 @@ }, { "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:0a26", - "id": "build28-b1", - "os": "Mac-10.12", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:0a26", - "id": "build28-b1", - "os": "Mac-10.12", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "webrtc.datachannel", "-v", "--upload-results", @@ -43450,65 +43037,6 @@ }, { "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "1002:6821", - "id": "build132-b1", - "os": "Mac-10.11", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "1002:6821", - "id": "build132-b1", - "os": "Mac-10.11", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "webrtc.datachannel", "-v", "--upload-results", @@ -49698,65 +49226,6 @@ }, { "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:0d26", - "id": "build8-b1", - "os": "Mac-10.11", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:0d26", - "id": "build8-b1", - "os": "Mac-10.11", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "webrtc.datachannel", "-v", "--upload-results", @@ -55926,65 +55395,6 @@ }, { "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release_x64" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:1616", - "id": "build180-b4", - "os": "Windows-10-10240", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:1616", - "id": "build180-b4", - "os": "Windows-10-10240", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "webrtc.datachannel", "-v", "--upload-results", @@ -62174,65 +61584,6 @@ }, { "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release_x64" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build136-m1", - "os": "Windows-10-10240", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0534", - "id": "build136-m1", - "os": "Windows-10-10240", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "webrtc.datachannel", "-v", "--upload-results", @@ -68482,65 +67833,6 @@ }, { "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release_x64" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "1002:6613", - "id": "build105-m1", - "os": "Windows-2008ServerR2-SP1", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "1002:6613", - "id": "build105-m1", - "os": "Windows-2008ServerR2-SP1", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "webrtc.datachannel", "-v", "--upload-results", @@ -74770,65 +74062,6 @@ }, { "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release_x64" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:041a", - "id": "build168-m1", - "os": "Windows-2008ServerR2-SP1", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:041a", - "id": "build168-m1", - "os": "Windows-2008ServerR2-SP1", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "webrtc.datachannel", "-v", "--upload-results", @@ -81078,65 +80311,6 @@ }, { "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release_x64" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "10de:104a", - "id": "build96-m1", - "os": "Windows-2008ServerR2-SP1", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "10de:104a", - "id": "build96-m1", - "os": "Windows-2008ServerR2-SP1", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "webrtc.datachannel", "-v", "--upload-results", @@ -87366,65 +86540,6 @@ }, { "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0532", - "id": "build189-m1", - "os": "Windows-2008ServerR2-SP1", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0532", - "id": "build189-m1", - "os": "Windows-2008ServerR2-SP1", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "webrtc.datachannel", "-v", "--upload-results", @@ -93634,65 +92749,6 @@ }, { "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release_x64" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0532", - "id": "build142-m1", - "os": "Windows-2008ServerR2-SP1", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0532", - "id": "build142-m1", - "os": "Windows-2008ServerR2-SP1", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "webrtc.datachannel", "-v", "--upload-results", @@ -99922,65 +98978,6 @@ }, { "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=release_x64" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0532", - "id": "build147-m1", - "os": "Windows-2012ServerR2-SP0", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "v8.top_25_smooth", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "v8.top_25_smooth.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "102b:0532", - "id": "build147-m1", - "os": "Windows-2012ServerR2-SP0", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 9000, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "webrtc.datachannel", "-v", "--upload-results",
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index c4a04d1..cd69f10 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -3239,8 +3239,6 @@ crbug.com/701445 external/wpt/dom/events/EventListener-invoke-legacy.html [ Timeout Pass ] -crbug.com/718394 virtual/enable_asmjs/http/tests/asmjs/asm-warnings.html [ NeedsManualRebaseline ] - # When WebAssembly is exposed in V8 (soon), this test has the wrong number of expected Object.getOwnPropertyNames() for global object. crbug.com/681468 fast/forms/suggestion-picker/date-suggestion-picker-appearance-zoom125.html [ Failure Pass ]
diff --git a/third_party/WebKit/LayoutTests/virtual/enable_asmjs/http/tests/asmjs/asm-warnings-expected.txt b/third_party/WebKit/LayoutTests/virtual/enable_asmjs/http/tests/asmjs/asm-warnings-expected.txt index c9915986..005d2db 100644 --- a/third_party/WebKit/LayoutTests/virtual/enable_asmjs/http/tests/asmjs/asm-warnings-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/enable_asmjs/http/tests/asmjs/asm-warnings-expected.txt
@@ -1,3 +1,3 @@ -CONSOLE WARNING: line 13: Invalid asm.js: Invalid type annotation - forbidden literal. -CONSOLE WARNING: line 5: Invalid asm.js: Invalid initializer for foreign import - unrecognized annotation. +CONSOLE WARNING: line 13: Invalid asm.js: Bad variable declaration +CONSOLE WARNING: line 5: Invalid asm.js: Can only use immutable variables in global definition
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp b/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp index ae96a224..dfc83aea4 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
@@ -441,6 +441,11 @@ // precise GC to ensure that we collect all available garbage. current_thread_state->SchedulePreciseGC(); } + + // Schedules a precise GC for the next idle time period. + if (flags & v8::kGCCallbackScheduleIdleGarbageCollection) { + current_thread_state->ScheduleIdleGC(); + } } TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"),
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py index 7d09d3e..cd7b662e5f 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py
@@ -1372,7 +1372,13 @@ def _apache_version(self): config = self._executive.run_command([self.path_to_apache(), '-v']) - return re.sub(r'(?:.|\n)*Server version: Apache/(\d+\.\d+)(?:.|\n)*', r'\1', config) + # Log version including patch level. + _log.debug('Found apache version %s', re.sub( + r'(?:.|\n)*Server version: Apache/(\d+\.\d+(?:\.\d+)?)(?:.|\n)*', + r'\1', config)) + return re.sub( + r'(?:.|\n)*Server version: Apache/(\d+\.\d+)(?:.|\n)*', + r'\1', config) def _apache_config_file_name_for_platform(self): if self.host.platform.is_linux():
diff --git a/tools/binary_size/README.md b/tools/binary_size/README.md index 19bf7f3..f0b6439 100644 --- a/tools/binary_size/README.md +++ b/tools/binary_size/README.md
@@ -1,7 +1,8 @@ # Tools for Analyzing Chrome's Binary Size -These currently focus on Android and Linux platforms. However, some great tools -for Windows exist and are documented here: +These tools currently focus on Android compiled with GCC. They somewhat work +for Android + Clang, and Linux builds, but not as well. As for Windows, some +great tools already exist and are documented here: * https://www.chromium.org/developers/windows-binary-sizes
diff --git a/tools/binary_size/libsupersize/archive.py b/tools/binary_size/libsupersize/archive.py index f47ab14..d8aa1a4 100644 --- a/tools/binary_size/libsupersize/archive.py +++ b/tools/binary_size/libsupersize/archive.py
@@ -324,8 +324,11 @@ num_new_symbols += len(name_list) - 1 if float(num_new_symbols) / len(raw_symbols) < .05: + # TODO(agrieve): Figure out if there's a way to get alias information from + # clang-compiled nm. logging.warning('Number of aliases is oddly low (%.0f%%). It should ' - 'usually be around 25%%. Ensure --tool-prefix is correct.', + 'usually be around 25%%. Ensure --tool-prefix is correct. ' + 'Ignore this if you compiled with clang.', float(num_new_symbols) / len(raw_symbols) * 100) # Step 2: Create new symbols as siblings to each existing one. @@ -404,8 +407,7 @@ return metadata -def CreateSizeInfo(map_path, elf_path, tool_prefix, output_directory, - raw_only=False): +def CreateSizeInfo(map_path, elf_path, tool_prefix, output_directory): """Creates a SizeInfo. Args: @@ -415,7 +417,6 @@ tool_prefix: Prefix for c++filt & nm (required). output_directory: Build output directory. If None, source_paths and symbol alias information will not be recorded. - raw_only: Fill in just the information required for creating a .size file. """ source_mapper = None if output_directory: @@ -507,17 +508,13 @@ size_info = models.SizeInfo(section_sizes, raw_symbols) - # Name normalization not strictly required, but makes for smaller files. - if raw_only: - logging.info('Normalizing symbol names') - _NormalizeNames(size_info.raw_symbols) - else: - _PostProcessSizeInfo(size_info) + # When creating the .size file, name normalization is not strictly required, + # but makes for smaller files. + # Padding not required either, but it is useful to check for large padding and + # log a warning. + _PostProcessSizeInfo(size_info) - if logging.getLogger().isEnabledFor(logging.DEBUG): - # Padding is reported in size coverage logs. - if raw_only: - _CalculatePadding(size_info.raw_symbols) + if logging.getLogger().isEnabledFor(logging.INFO): for line in describe.DescribeSizeInfoCoverage(size_info): logging.info(line) logging.info('Recorded info for %d symbols', len(size_info.raw_symbols)) @@ -664,8 +661,7 @@ apk_elf_result = concurrent.ForkAndCall( _ElfInfoFromApk, (apk_path, apk_so_path, tool_prefix)) - size_info = CreateSizeInfo( - map_path, elf_path, tool_prefix, output_directory, raw_only=True) + size_info = CreateSizeInfo(map_path, elf_path, tool_prefix, output_directory) if metadata: size_info.metadata = metadata
diff --git a/tools/binary_size/libsupersize/function_signature.py b/tools/binary_size/libsupersize/function_signature.py index 199d514..fbd1e67 100644 --- a/tools/binary_size/libsupersize/function_signature.py +++ b/tools/binary_size/libsupersize/function_signature.py
@@ -102,12 +102,23 @@ last_right_idx = left_idx -def _NormalizeTopLevelLambda(name, space_idx, left_paren_idx): - # cc::{lambda(PaintOp*)#63}::_FUN() -> cc:{lambda#63}() - paren_idx = name.index('(', space_idx + 1) - hash_idx = name.rindex('#', paren_idx) - return (name[:paren_idx] + name[hash_idx:left_paren_idx - 6] + - name[left_paren_idx:]) +def _NormalizeTopLevelGccLambda(name, left_paren_idx): + # cc::{lambda(PaintOp*)#63}::_FUN() -> cc::$lambda#63() + left_brace_idx = name.index('{') + hash_idx = name.index('#', left_brace_idx + 1) + right_brace_idx = name.index('}', hash_idx + 1) + number = name[hash_idx + 1:right_brace_idx] + return '{}$lambda#{}{}'.format( + name[:left_brace_idx], number, name[left_paren_idx:]) + + +def _NormalizeTopLevelClangLambda(name, left_paren_idx): + # cc::$_21::__invoke() -> cc::$lambda#21() + dollar_idx = name.index('$') + colon_idx = name.index(':', dollar_idx + 1) + number = name[dollar_idx + 2:colon_idx] + return '{}$lambda#{}{}'.format( + name[:dollar_idx], number, name[left_paren_idx:]) def Parse(name): @@ -133,7 +144,11 @@ if name_no_params.endswith('}::_FUN'): # Don't use name_no_params in here since prior _idx will be off if # there was a return value. - name = _NormalizeTopLevelLambda(name, space_idx, left_paren_idx) + name = _NormalizeTopLevelGccLambda(name, left_paren_idx) + return Parse(name) + elif name_no_params.endswith('::__invoke') and '$' in name_no_params: + assert '$_' in name_no_params, 'Surprising lambda: ' + name + name = _NormalizeTopLevelClangLambda(name, left_paren_idx) return Parse(name) full_name = name[space_idx + 1:]
diff --git a/tools/binary_size/libsupersize/function_signature_test.py b/tools/binary_size/libsupersize/function_signature_test.py index 757da72..b830366b 100755 --- a/tools/binary_size/libsupersize/function_signature_test.py +++ b/tools/binary_size/libsupersize/function_signature_test.py
@@ -110,9 +110,16 @@ SIG = 'cc::{lambda(cc::PaintOp*)#63}::_FUN(cc::PaintOp*)' got_full_name, got_template_name, got_name = ( function_signature.Parse(SIG)) - self.assertEqual('cc::{lambda#63}', got_name) - self.assertEqual('cc::{lambda#63}', got_template_name) - self.assertEqual('cc::{lambda#63}(cc::PaintOp*)', got_full_name) + self.assertEqual('cc::$lambda#63', got_name) + self.assertEqual('cc::$lambda#63', got_template_name) + self.assertEqual('cc::$lambda#63(cc::PaintOp*)', got_full_name) + + SIG = 'cc::$_63::__invoke(cc::PaintOp*)' + got_full_name, got_template_name, got_name = ( + function_signature.Parse(SIG)) + self.assertEqual('cc::$lambda#63', got_name) + self.assertEqual('cc::$lambda#63', got_template_name) + self.assertEqual('cc::$lambda#63(cc::PaintOp*)', got_full_name) # Data members check('', 'blink::CSSValueKeywordsHash::findValueImpl', '(char const*)',
diff --git a/tools/binary_size/libsupersize/linker_map_parser.py b/tools/binary_size/libsupersize/linker_map_parser.py index 21119b3d..00bf04c 100644 --- a/tools/binary_size/libsupersize/linker_map_parser.py +++ b/tools/binary_size/libsupersize/linker_map_parser.py
@@ -161,6 +161,8 @@ sym = models.Symbol(section_name, size, address=address, full_name=name, object_path=path) syms.append(sym) + if merge_symbol_start_address > 0: + merge_symbol_start_address += size else: # A normal symbol entry. subsection_name, address_str, size_str, path = (
diff --git a/tools/binary_size/libsupersize/models.py b/tools/binary_size/libsupersize/models.py index 88716da..94259f0 100644 --- a/tools/binary_size/libsupersize/models.py +++ b/tools/binary_size/libsupersize/models.py
@@ -230,11 +230,11 @@ self.padding = 0 def __repr__(self): - template = ('{}@{:x}(size_without_padding={},padding={},name={},' + template = ('{}@{:x}(size_without_padding={},padding={},full_name={},' 'object_path={},source_path={},flags={})') return template.format( self.section_name, self.address, self.size_without_padding, - self.padding, self.name, self.object_path, self.source_path, + self.padding, self.full_name, self.object_path, self.source_path, self.FlagsString()) @property @@ -289,8 +289,8 @@ self.is_sorted = is_sorted def __repr__(self): - return 'Group(name=%s,count=%d,size=%d)' % ( - self.name, len(self), self.size) + return 'Group(full_name=%s,count=%d,size=%d)' % ( + self.full_name, len(self), self.size) def __iter__(self): return iter(self._symbols)
diff --git a/tools/binary_size/libsupersize/nm.py b/tools/binary_size/libsupersize/nm.py index a312b2c..bb75732 100644 --- a/tools/binary_size/libsupersize/nm.py +++ b/tools/binary_size/libsupersize/nm.py
@@ -17,6 +17,16 @@ _active_subprocesses = None +def _IsRelevantNmName(name): + # Skip lines like: + # 00000000 t $t + # 00000000 r $d + # 0000041b r .L.str.38 + # 00000344 N + return name and not name.startswith('.L.str.') and not ( + len(name) == 2 and name.startswith('$')) + + def CollectAliasesByAddress(elf_path, tool_prefix): """Runs nm on |elf_path| and returns a dict of address->[names]""" names_by_address = collections.defaultdict(list) @@ -27,12 +37,16 @@ elf_path] output = subprocess.check_output(args) for line in output.splitlines(): - address_str, section, name = line.split(' ', 2) + space_idx = line.find(' ') + address_str = line[:space_idx] + section = line[space_idx + 1] + name = line[space_idx + 3:] + # To verify that rodata does not have aliases: # nm --no-sort --defined-only libchrome.so > nm.out # grep -v '\$' nm.out | grep ' r ' | sort | cut -d' ' -f1 > addrs # wc -l < addrs; uniq < addrs | wc -l - if section not in 'tT' or not name or name[0] == '$': + if section not in 'tT' or not _IsRelevantNmName(name): continue address = int(address_str, 16) @@ -71,14 +85,9 @@ for line in lines: if not line: break - sep = line.find(' ') # Skip over address. - sep = line.find(' ', sep + 1) # Skip over symbol type. - name = line[sep + 1:] - # Skip lines like: - # 00000000 t $t - # 00000000 r $d - # 0000041b r .L.str.38 - if name[0] not in '$.': + space_idx = line.find(' ') # Skip over address. + name = line[space_idx + 3:] + if _IsRelevantNmName(name): ret.append(name) return ret
diff --git a/tools/binary_size/libsupersize/testdata/Archive.golden b/tools/binary_size/libsupersize/testdata/Archive.golden index 587eb9a..9701955 100644 --- a/tools/binary_size/libsupersize/testdata/Archive.golden +++ b/tools/binary_size/libsupersize/testdata/Archive.golden
@@ -1,6 +1,6 @@ -Section r: has 100.0% of 5927652 bytes accounted for from 9 symbols. 0 bytes are unaccounted for. +Section r: has 100.0% of 5927652 bytes accounted for from 10 symbols. 0 bytes are unaccounted for. * Padding accounts for 11 bytes (0.0%) -* 4 placeholders (symbols that start with **) account for 5927509 bytes (100.0%) +* 5 placeholders (symbols that start with **) account for 5927509 bytes (100.0%) * 0 symbols have shared ownership Section b: has 40.3% of 524520 bytes accounted for from 6 symbols. 775936 bytes are unaccounted for. * Padding accounts for 196 bytes (0.0%) @@ -14,48 +14,49 @@ * 3 placeholders (symbols that start with **) account for 35830760 bytes (99.8%) * Contains 0 aliases * 0 symbols have shared ownership -.text@28d900(size_without_padding=16,padding=0,name=_GLOBAL__sub_I_page_allocator.cc,object_path=base/base/page_allocator.o,source_path=,flags={startup}) -.text@28d910(size_without_padding=56,padding=0,name=_GLOBAL__sub_I_bbr_sender.cc,object_path=base/base/page_allocator.o,source_path=,flags={startup}) -.text@28d948(size_without_padding=28,padding=0,name=_GLOBAL__sub_I_pacing_sender.cc,object_path=base/base/page_allocator.o,source_path=,flags={startup}) -.text@28d964(size_without_padding=38,padding=0,name=extFromUUseMapping,object_path=base/base/page_allocator.o,source_path=,flags={}) -.text@28d98a(size_without_padding=32,padding=0,name=extFromUUseMapping,object_path=base/base/page_allocator.o,source_path=,flags={}) -.text@28f000(size_without_padding=0,padding=5718,name=** symbol gap 0,object_path=,source_path=,flags={}) -.text@28f000(size_without_padding=448,padding=0,name=ucnv_extMatchFromU,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=,flags={}) -.text@28f1c8(size_without_padding=20,padding=8,name=_GLOBAL__sub_I_SkDeviceProfile.cpp,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=,flags={startup}) -.text@28f1e0(size_without_padding=69120,padding=4,name=foo_bar,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=,flags={unlikely}) -.text@2a0000(size_without_padding=16,padding=32,name=blink::ContiguousContainerBase::shrinkToFit,object_path=third_party/WebKit.a/PaintChunker.o,source_path=,flags={}) -.text@2a0010(size_without_padding=12,padding=0,name=blink::ContiguousContainerBase::shrinkToFit [clone .part.1234] [clone .isra.2],object_path=third_party/WebKit.a/PaintChunker.o,source_path=,flags={}) -.text@2a0020(size_without_padding=24,padding=4,name=blink::ContiguousContainerBase::ContiguousContainerBase,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=,flags={}) -.text@2a1000(size_without_padding=0,padding=4040,name=** symbol gap 1,object_path=,source_path=,flags={}) -.text@2a1000(size_without_padding=94,padding=0,name=blink::PaintChunker::releasePaintChunks [clone .part.1],object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=,flags={anon}) -.text@24ca628(size_without_padding=0,padding=35821002,name=** symbol gap 2 (end of section),object_path=,source_path=,flags={}) -.rodata@266e600(size_without_padding=1965409,padding=0,name=** merge strings,object_path=,source_path=,flags={}) -.rodata@284e364(size_without_padding=0,padding=3,name=** symbol gap 2,object_path=,source_path=,flags={}) -.rodata@284e364(size_without_padding=8,padding=0,name=,object_path=base/base/page_allocator.o,source_path=,flags={}) -.rodata@284e370(size_without_padding=40,padding=4,name=Name,object_path=base/base/page_allocator.o,source_path=,flags={}) -.rodata@284e398(size_without_padding=32,padding=0,name=chrome::mojom::FilePatcher::Name_,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=,flags={}) -.rodata@284e518(size_without_padding=675633,padding=352,name=** merge strings,object_path=,source_path=,flags={}) -.rodata@28f3450(size_without_padding=48,padding=7,name=kAnimationFrameTimeHistogramClassPath,object_path=third_party/WebKit.a/PaintChunker.o,source_path=,flags={anon}) -.rodata@28f3480(size_without_padding=4,padding=0,name=blink::CSSValueKeywordsHash::findValueImpl::value_word_list,object_path=third_party/WebKit.a/PaintChunker.o,source_path=,flags={anon}) -.rodata@2c158e4(size_without_padding=0,padding=3286112,name=** symbol gap 3 (end of section),object_path=,source_path=,flags={}) -.data.rel.ro.local@2c176f0(size_without_padding=56,padding=0,name=ChromeMainDelegate [vtable],object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=,flags={}) -.data.rel.ro.local@2c17728(size_without_padding=24,padding=0,name=chrome::mojom::FieldTrialRecorder [vtable],object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=,flags={}) -.data.rel.ro.local@2c17740(size_without_padding=789904,padding=0,name=chrome::mojom::FieldTrialRecorderProxy [vtable],object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=,flags={}) -.data.rel.ro.local@2cd84e0(size_without_padding=16,padding=16,name=.Lswitch.table.45,object_path=third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libcontroller_api_impl.a_controller_api_impl.o,source_path=,flags={}) -.data.rel.ro.local@2cd84f0(size_without_padding=8,padding=0,name=kSystemClassPrefixes,object_path=third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libport_android_jni.a_jni_utils.o,source_path=,flags={anon}) -.data.rel.ro@2cd8500(size_without_padding=56,padding=0,name=ChromeMainDelegateAndroid [vtable],object_path=third_party/WebKit.a/PaintChunker.o,source_path=,flags={}) -.data.rel.ro@2cd8538(size_without_padding=24,padding=0,name=mojo::MessageReceiver [vtable],object_path=base/base/page_allocator.o,source_path=,flags={}) -.data.rel.ro@2cd8550(size_without_padding=12,padding=0,name=kMethodsAnimationFrameTimeHistogram,object_path=base/base/page_allocator.o,source_path=,flags={}) -.data.rel.ro@2ddc608(size_without_padding=0,padding=1065132,name=** symbol gap 3 (end of section),object_path=,source_path=,flags={}) -.data@2de7000(size_without_padding=4,padding=0,name=google::protobuf::internal::pLinuxKernelCmpxchg,object_path=base/base/page_allocator.o,source_path=,flags={}) -.data@2de7004(size_without_padding=4,padding=0,name=google::protobuf::internal::pLinuxKernelMemoryBarrier,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=,flags={}) -.data@2de7008(size_without_padding=152,padding=0,name=base::android::kBaseRegisteredMethods,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=,flags={rel}) -.data@2de70a0(size_without_padding=4,padding=0,name=base::android::g_renderer_histogram_code,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=,flags={anon}) -.data@2de70a4(size_without_padding=4,padding=0,name=base::android::g_library_version_number,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=,flags={anon,rel.loc}) -.data@2dffd88(size_without_padding=0,padding=101600,name=** symbol gap 3 (end of section),object_path=,source_path=,flags={}) -.bss@0(size_without_padding=262144,padding=0,name=ff_cos_131072,object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_float.o,source_path=,flags={}) -.bss@0(size_without_padding=131072,padding=0,name=ff_cos_131072_fixed,object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_fixed.o,source_path=,flags={}) -.bss@0(size_without_padding=131072,padding=0,name=ff_cos_65536,object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_float.o,source_path=,flags={}) -.bss@2dffda0(size_without_padding=28,padding=0,name=g_chrome_content_browser_client,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=,flags={}) -.bss@2dffe80(size_without_padding=4,padding=196,name=SaveHistogram::atomic_histogram_pointer,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=,flags={}) -.bss@2dffe84(size_without_padding=4,padding=0,name=g_AnimationFrameTimeHistogram_clazz,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=,flags={anon}) +.text@28d900(size_without_padding=16,padding=0,full_name=_GLOBAL__sub_I_page_allocator.cc,object_path=base/base/page_allocator.o,source_path=,flags={startup}) +.text@28d910(size_without_padding=56,padding=0,full_name=_GLOBAL__sub_I_bbr_sender.cc,object_path=base/base/page_allocator.o,source_path=,flags={startup}) +.text@28d948(size_without_padding=28,padding=0,full_name=_GLOBAL__sub_I_pacing_sender.cc,object_path=base/base/page_allocator.o,source_path=,flags={startup}) +.text@28d964(size_without_padding=38,padding=0,full_name=extFromUUseMapping(signed char, unsigned int, int),object_path=base/base/page_allocator.o,source_path=,flags={}) +.text@28d98a(size_without_padding=32,padding=0,full_name=extFromUUseMapping(aj, int),object_path=base/base/page_allocator.o,source_path=,flags={}) +.text@28f000(size_without_padding=0,padding=5718,full_name=** symbol gap 0,object_path=,source_path=,flags={}) +.text@28f000(size_without_padding=448,padding=0,full_name=ucnv_extMatchFromU(int const*, int, unsigned short const*, int, unsigned short const*, int, unsigned int*, signed char, signed char),object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=,flags={}) +.text@28f1c8(size_without_padding=20,padding=8,full_name=_GLOBAL__sub_I_SkDeviceProfile.cpp,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=,flags={startup}) +.text@28f1e0(size_without_padding=69120,padding=4,full_name=foo_bar,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=,flags={unlikely}) +.text@2a0000(size_without_padding=16,padding=32,full_name=blink::ContiguousContainerBase::shrinkToFit(),object_path=third_party/WebKit.a/PaintChunker.o,source_path=,flags={}) +.text@2a0010(size_without_padding=12,padding=0,full_name=blink::ContiguousContainerBase::shrinkToFit() [clone .part.1234] [clone .isra.2],object_path=third_party/WebKit.a/PaintChunker.o,source_path=,flags={}) +.text@2a0020(size_without_padding=24,padding=4,full_name=blink::ContiguousContainerBase::ContiguousContainerBase(blink::ContiguousContainerBase&&),object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=,flags={}) +.text@2a1000(size_without_padding=0,padding=4040,full_name=** symbol gap 1,object_path=,source_path=,flags={}) +.text@2a1000(size_without_padding=94,padding=0,full_name=blink::PaintChunker::releasePaintChunks() [clone .part.1],object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=,flags={anon}) +.text@24ca628(size_without_padding=0,padding=35821002,full_name=** symbol gap 2 (end of section),object_path=,source_path=,flags={}) +.rodata@266e600(size_without_padding=1961984,padding=0,full_name=** merge strings,object_path=,source_path=,flags={}) +.rodata@284d600(size_without_padding=3425,padding=0,full_name=** merge constants,object_path=,source_path=,flags={}) +.rodata@284e364(size_without_padding=0,padding=3,full_name=** symbol gap 2,object_path=,source_path=,flags={}) +.rodata@284e364(size_without_padding=8,padding=0,full_name=,object_path=base/base/page_allocator.o,source_path=,flags={}) +.rodata@284e370(size_without_padding=40,padding=4,full_name=Name,object_path=base/base/page_allocator.o,source_path=,flags={}) +.rodata@284e398(size_without_padding=32,padding=0,full_name=chrome::mojom::FilePatcher::Name_,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=,flags={}) +.rodata@284e518(size_without_padding=675633,padding=352,full_name=** merge strings,object_path=,source_path=,flags={}) +.rodata@28f3450(size_without_padding=48,padding=7,full_name=kAnimationFrameTimeHistogramClassPath,object_path=third_party/WebKit.a/PaintChunker.o,source_path=,flags={anon}) +.rodata@28f3480(size_without_padding=4,padding=0,full_name=blink::CSSValueKeywordsHash::findValueImpl(char const*, unsigned int)::value_word_list,object_path=third_party/WebKit.a/PaintChunker.o,source_path=,flags={anon}) +.rodata@2c158e4(size_without_padding=0,padding=3286112,full_name=** symbol gap 3 (end of section),object_path=,source_path=,flags={}) +.data.rel.ro.local@2c176f0(size_without_padding=56,padding=0,full_name=ChromeMainDelegate [vtable],object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=,flags={}) +.data.rel.ro.local@2c17728(size_without_padding=24,padding=0,full_name=chrome::mojom::FieldTrialRecorder [vtable],object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=,flags={}) +.data.rel.ro.local@2c17740(size_without_padding=789904,padding=0,full_name=chrome::mojom::FieldTrialRecorderProxy [vtable],object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=,flags={}) +.data.rel.ro.local@2cd84e0(size_without_padding=16,padding=16,full_name=.Lswitch.table.45,object_path=third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libcontroller_api_impl.a_controller_api_impl.o,source_path=,flags={}) +.data.rel.ro.local@2cd84f0(size_without_padding=8,padding=0,full_name=kSystemClassPrefixes,object_path=third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libport_android_jni.a_jni_utils.o,source_path=,flags={anon}) +.data.rel.ro@2cd8500(size_without_padding=56,padding=0,full_name=ChromeMainDelegateAndroid [vtable],object_path=third_party/WebKit.a/PaintChunker.o,source_path=,flags={}) +.data.rel.ro@2cd8538(size_without_padding=24,padding=0,full_name=mojo::MessageReceiver [vtable],object_path=base/base/page_allocator.o,source_path=,flags={}) +.data.rel.ro@2cd8550(size_without_padding=12,padding=0,full_name=kMethodsAnimationFrameTimeHistogram,object_path=base/base/page_allocator.o,source_path=,flags={}) +.data.rel.ro@2ddc608(size_without_padding=0,padding=1065132,full_name=** symbol gap 3 (end of section),object_path=,source_path=,flags={}) +.data@2de7000(size_without_padding=4,padding=0,full_name=google::protobuf::internal::pLinuxKernelCmpxchg,object_path=base/base/page_allocator.o,source_path=,flags={}) +.data@2de7004(size_without_padding=4,padding=0,full_name=google::protobuf::internal::pLinuxKernelMemoryBarrier,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=,flags={}) +.data@2de7008(size_without_padding=152,padding=0,full_name=base::android::kBaseRegisteredMethods,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=,flags={rel}) +.data@2de70a0(size_without_padding=4,padding=0,full_name=base::android::g_renderer_histogram_code,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=,flags={anon}) +.data@2de70a4(size_without_padding=4,padding=0,full_name=base::android::g_library_version_number,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=,flags={anon,rel.loc}) +.data@2dffd88(size_without_padding=0,padding=101600,full_name=** symbol gap 3 (end of section),object_path=,source_path=,flags={}) +.bss@0(size_without_padding=262144,padding=0,full_name=ff_cos_131072,object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_float.o,source_path=,flags={}) +.bss@0(size_without_padding=131072,padding=0,full_name=ff_cos_131072_fixed,object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_fixed.o,source_path=,flags={}) +.bss@0(size_without_padding=131072,padding=0,full_name=ff_cos_65536,object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_float.o,source_path=,flags={}) +.bss@2dffda0(size_without_padding=28,padding=0,full_name=g_chrome_content_browser_client,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=,flags={}) +.bss@2dffe80(size_without_padding=4,padding=196,full_name=SaveHistogram(_JNIEnv*, base::android::JavaParamRef<_jobject*> const&, base::android::JavaParamRef<_jstring*> const&, base::android::JavaParamRef<_jlongArray*> const&, int)::atomic_histogram_pointer,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=,flags={}) +.bss@2dffe84(size_without_padding=4,padding=0,full_name=g_AnimationFrameTimeHistogram_clazz,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=,flags={anon})
diff --git a/tools/binary_size/libsupersize/testdata/Archive_Elf.golden b/tools/binary_size/libsupersize/testdata/Archive_Elf.golden index c2fd8d5..59a0cbd 100644 --- a/tools/binary_size/libsupersize/testdata/Archive_Elf.golden +++ b/tools/binary_size/libsupersize/testdata/Archive_Elf.golden
@@ -6,9 +6,9 @@ gn_args=var1=true var2="foo" map_file_name=../test.map tool_prefix=tools/binary_size/libsupersize/testdata/mock_toolchain/ -Section r: has 100.0% of 5927652 bytes accounted for from 9 symbols. 0 bytes are unaccounted for. +Section r: has 100.0% of 5927652 bytes accounted for from 10 symbols. 0 bytes are unaccounted for. * Padding accounts for 11 bytes (0.0%) -* 4 placeholders (symbols that start with **) account for 5927509 bytes (100.0%) +* 5 placeholders (symbols that start with **) account for 5927509 bytes (100.0%) * 0 symbols have shared ownership Section b: has 40.3% of 524520 bytes accounted for from 6 symbols. 775936 bytes are unaccounted for. * Padding accounts for 196 bytes (0.0%) @@ -22,51 +22,52 @@ * 3 placeholders (symbols that start with **) account for 35830760 bytes (99.8%) * Contains 5 aliases, mapped to 2 unique addresses (60 bytes) * 1 symbols have shared ownership (12 bytes) -.text@28d900(size_without_padding=16,padding=0,name=_GLOBAL__sub_I_page_allocator.cc,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={startup}) -.text@28d910(size_without_padding=56,padding=0,name=_GLOBAL__sub_I_bbr_sender.cc,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={startup}) -.text@28d948(size_without_padding=28,padding=0,name=_GLOBAL__sub_I_pacing_sender.cc,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={startup}) -.text@28d964(size_without_padding=38,padding=0,name=extFromUUseMapping,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) -.text@28d98a(size_without_padding=32,padding=0,name=extFromUUseMapping,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) -.text@28f000(size_without_padding=0,padding=5718,name=** symbol gap 0,object_path=,source_path=,flags={}) -.text@28f000(size_without_padding=448,padding=0,name=ucnv_extMatchFromU,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen}) -.text@28f1c8(size_without_padding=20,padding=8,name=_GLOBAL__sub_I_SkDeviceProfile.cpp,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={startup,gen}) -.text@28f1e0(size_without_padding=69120,padding=4,name=foo_bar,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={unlikely,gen}) -.text@2a0000(size_without_padding=16,padding=32,name=blink::ContiguousContainerBase::shrinkToFit,object_path=,source_path=,flags={2 aliases}) -.text@2a0000(size_without_padding=16,padding=32,name=BazAlias,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen,2 aliases}) -.text@2a0010(size_without_padding=12,padding=0,name=blink::ContiguousContainerBase::shrinkToFit [clone .part.1234] [clone .isra.2],object_path=third_party/{shared}/2,source_path=third_party/{shared}/2,flags={3 aliases}) -.text@2a0010(size_without_padding=12,padding=0,name=FooAlias,object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_float.o,source_path=third_party/fft_float.cc,flags={3 aliases}) -.text@2a0010(size_without_padding=12,padding=0,name=BarAlias,object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_float.o,source_path=third_party/fft_float.cc,flags={3 aliases}) -.text@2a0020(size_without_padding=24,padding=4,name=blink::ContiguousContainerBase::ContiguousContainerBase,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={}) -.text@2a1000(size_without_padding=0,padding=4040,name=** symbol gap 1,object_path=,source_path=,flags={}) -.text@2a1000(size_without_padding=94,padding=0,name=blink::PaintChunker::releasePaintChunks [clone .part.1],object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={anon}) -.text@24ca628(size_without_padding=0,padding=35821002,name=** symbol gap 2 (end of section),object_path=,source_path=,flags={}) -.rodata@266e600(size_without_padding=1965409,padding=0,name=** merge strings,object_path=,source_path=,flags={}) -.rodata@284e364(size_without_padding=0,padding=3,name=** symbol gap 2,object_path=,source_path=,flags={}) -.rodata@284e364(size_without_padding=8,padding=0,name=,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) -.rodata@284e370(size_without_padding=40,padding=4,name=Name,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) -.rodata@284e398(size_without_padding=32,padding=0,name=chrome::mojom::FilePatcher::Name_,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={}) -.rodata@284e518(size_without_padding=675633,padding=352,name=** merge strings,object_path=,source_path=,flags={}) -.rodata@28f3450(size_without_padding=48,padding=7,name=kAnimationFrameTimeHistogramClassPath,object_path=third_party/WebKit.a/PaintChunker.o,source_path=third_party/paint.cc,flags={anon}) -.rodata@28f3480(size_without_padding=4,padding=0,name=blink::CSSValueKeywordsHash::findValueImpl::value_word_list,object_path=third_party/WebKit.a/PaintChunker.o,source_path=third_party/paint.cc,flags={anon}) -.rodata@2c158e4(size_without_padding=0,padding=3286112,name=** symbol gap 3 (end of section),object_path=,source_path=,flags={}) -.data.rel.ro.local@2c176f0(size_without_padding=56,padding=0,name=ChromeMainDelegate [vtable],object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen}) -.data.rel.ro.local@2c17728(size_without_padding=24,padding=0,name=chrome::mojom::FieldTrialRecorder [vtable],object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen}) -.data.rel.ro.local@2c17740(size_without_padding=789904,padding=0,name=chrome::mojom::FieldTrialRecorderProxy [vtable],object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={}) -.data.rel.ro.local@2cd84e0(size_without_padding=16,padding=16,name=.Lswitch.table.45,object_path=third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libcontroller_api_impl.a_controller_api_impl.o,source_path=,flags={}) -.data.rel.ro.local@2cd84f0(size_without_padding=8,padding=0,name=kSystemClassPrefixes,object_path=third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libport_android_jni.a_jni_utils.o,source_path=,flags={anon}) -.data.rel.ro@2cd8500(size_without_padding=56,padding=0,name=ChromeMainDelegateAndroid [vtable],object_path=third_party/WebKit.a/PaintChunker.o,source_path=third_party/paint.cc,flags={}) -.data.rel.ro@2cd8538(size_without_padding=24,padding=0,name=mojo::MessageReceiver [vtable],object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) -.data.rel.ro@2cd8550(size_without_padding=12,padding=0,name=kMethodsAnimationFrameTimeHistogram,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) -.data.rel.ro@2ddc608(size_without_padding=0,padding=1065132,name=** symbol gap 3 (end of section),object_path=,source_path=,flags={}) -.data@2de7000(size_without_padding=4,padding=0,name=google::protobuf::internal::pLinuxKernelCmpxchg,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) -.data@2de7004(size_without_padding=4,padding=0,name=google::protobuf::internal::pLinuxKernelMemoryBarrier,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={}) -.data@2de7008(size_without_padding=152,padding=0,name=base::android::kBaseRegisteredMethods,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={rel}) -.data@2de70a0(size_without_padding=4,padding=0,name=base::android::g_renderer_histogram_code,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={anon}) -.data@2de70a4(size_without_padding=4,padding=0,name=base::android::g_library_version_number,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={anon,rel.loc}) -.data@2dffd88(size_without_padding=0,padding=101600,name=** symbol gap 3 (end of section),object_path=,source_path=,flags={}) -.bss@0(size_without_padding=262144,padding=0,name=ff_cos_131072,object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_float.o,source_path=third_party/fft_float.cc,flags={}) -.bss@0(size_without_padding=131072,padding=0,name=ff_cos_131072_fixed,object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_fixed.o,source_path=third_party/fft_fixed.cc,flags={}) -.bss@0(size_without_padding=131072,padding=0,name=ff_cos_65536,object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_float.o,source_path=third_party/fft_float.cc,flags={}) -.bss@2dffda0(size_without_padding=28,padding=0,name=g_chrome_content_browser_client,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen}) -.bss@2dffe80(size_without_padding=4,padding=196,name=SaveHistogram::atomic_histogram_pointer,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen}) -.bss@2dffe84(size_without_padding=4,padding=0,name=g_AnimationFrameTimeHistogram_clazz,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={anon,gen}) +.text@28d900(size_without_padding=16,padding=0,full_name=_GLOBAL__sub_I_page_allocator.cc,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={startup}) +.text@28d910(size_without_padding=56,padding=0,full_name=_GLOBAL__sub_I_bbr_sender.cc,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={startup}) +.text@28d948(size_without_padding=28,padding=0,full_name=_GLOBAL__sub_I_pacing_sender.cc,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={startup}) +.text@28d964(size_without_padding=38,padding=0,full_name=extFromUUseMapping(signed char, unsigned int, int),object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) +.text@28d98a(size_without_padding=32,padding=0,full_name=extFromUUseMapping(aj, int),object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) +.text@28f000(size_without_padding=0,padding=5718,full_name=** symbol gap 0,object_path=,source_path=,flags={}) +.text@28f000(size_without_padding=448,padding=0,full_name=ucnv_extMatchFromU(int const*, int, unsigned short const*, int, unsigned short const*, int, unsigned int*, signed char, signed char),object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen}) +.text@28f1c8(size_without_padding=20,padding=8,full_name=_GLOBAL__sub_I_SkDeviceProfile.cpp,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={startup,gen}) +.text@28f1e0(size_without_padding=69120,padding=4,full_name=foo_bar,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={unlikely,gen}) +.text@2a0000(size_without_padding=16,padding=32,full_name=blink::ContiguousContainerBase::shrinkToFit(),object_path=,source_path=,flags={2 aliases}) +.text@2a0000(size_without_padding=16,padding=32,full_name=BazAlias(bool),object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen,2 aliases}) +.text@2a0010(size_without_padding=12,padding=0,full_name=blink::ContiguousContainerBase::shrinkToFit() [clone .part.1234] [clone .isra.2],object_path=third_party/{shared}/2,source_path=third_party/{shared}/2,flags={3 aliases}) +.text@2a0010(size_without_padding=12,padding=0,full_name=FooAlias(),object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_float.o,source_path=third_party/fft_float.cc,flags={3 aliases}) +.text@2a0010(size_without_padding=12,padding=0,full_name=BarAlias(),object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_float.o,source_path=third_party/fft_float.cc,flags={3 aliases}) +.text@2a0020(size_without_padding=24,padding=4,full_name=blink::ContiguousContainerBase::ContiguousContainerBase(blink::ContiguousContainerBase&&),object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={}) +.text@2a1000(size_without_padding=0,padding=4040,full_name=** symbol gap 1,object_path=,source_path=,flags={}) +.text@2a1000(size_without_padding=94,padding=0,full_name=blink::PaintChunker::releasePaintChunks() [clone .part.1],object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={anon}) +.text@24ca628(size_without_padding=0,padding=35821002,full_name=** symbol gap 2 (end of section),object_path=,source_path=,flags={}) +.rodata@266e600(size_without_padding=1961984,padding=0,full_name=** merge strings,object_path=,source_path=,flags={}) +.rodata@284d600(size_without_padding=3425,padding=0,full_name=** merge constants,object_path=,source_path=,flags={}) +.rodata@284e364(size_without_padding=0,padding=3,full_name=** symbol gap 2,object_path=,source_path=,flags={}) +.rodata@284e364(size_without_padding=8,padding=0,full_name=,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) +.rodata@284e370(size_without_padding=40,padding=4,full_name=Name,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) +.rodata@284e398(size_without_padding=32,padding=0,full_name=chrome::mojom::FilePatcher::Name_,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={}) +.rodata@284e518(size_without_padding=675633,padding=352,full_name=** merge strings,object_path=,source_path=,flags={}) +.rodata@28f3450(size_without_padding=48,padding=7,full_name=kAnimationFrameTimeHistogramClassPath,object_path=third_party/WebKit.a/PaintChunker.o,source_path=third_party/paint.cc,flags={anon}) +.rodata@28f3480(size_without_padding=4,padding=0,full_name=blink::CSSValueKeywordsHash::findValueImpl(char const*, unsigned int)::value_word_list,object_path=third_party/WebKit.a/PaintChunker.o,source_path=third_party/paint.cc,flags={anon}) +.rodata@2c158e4(size_without_padding=0,padding=3286112,full_name=** symbol gap 3 (end of section),object_path=,source_path=,flags={}) +.data.rel.ro.local@2c176f0(size_without_padding=56,padding=0,full_name=ChromeMainDelegate [vtable],object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen}) +.data.rel.ro.local@2c17728(size_without_padding=24,padding=0,full_name=chrome::mojom::FieldTrialRecorder [vtable],object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen}) +.data.rel.ro.local@2c17740(size_without_padding=789904,padding=0,full_name=chrome::mojom::FieldTrialRecorderProxy [vtable],object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={}) +.data.rel.ro.local@2cd84e0(size_without_padding=16,padding=16,full_name=.Lswitch.table.45,object_path=third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libcontroller_api_impl.a_controller_api_impl.o,source_path=,flags={}) +.data.rel.ro.local@2cd84f0(size_without_padding=8,padding=0,full_name=kSystemClassPrefixes,object_path=third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libport_android_jni.a_jni_utils.o,source_path=,flags={anon}) +.data.rel.ro@2cd8500(size_without_padding=56,padding=0,full_name=ChromeMainDelegateAndroid [vtable],object_path=third_party/WebKit.a/PaintChunker.o,source_path=third_party/paint.cc,flags={}) +.data.rel.ro@2cd8538(size_without_padding=24,padding=0,full_name=mojo::MessageReceiver [vtable],object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) +.data.rel.ro@2cd8550(size_without_padding=12,padding=0,full_name=kMethodsAnimationFrameTimeHistogram,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) +.data.rel.ro@2ddc608(size_without_padding=0,padding=1065132,full_name=** symbol gap 3 (end of section),object_path=,source_path=,flags={}) +.data@2de7000(size_without_padding=4,padding=0,full_name=google::protobuf::internal::pLinuxKernelCmpxchg,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) +.data@2de7004(size_without_padding=4,padding=0,full_name=google::protobuf::internal::pLinuxKernelMemoryBarrier,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={}) +.data@2de7008(size_without_padding=152,padding=0,full_name=base::android::kBaseRegisteredMethods,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={rel}) +.data@2de70a0(size_without_padding=4,padding=0,full_name=base::android::g_renderer_histogram_code,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={anon}) +.data@2de70a4(size_without_padding=4,padding=0,full_name=base::android::g_library_version_number,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={anon,rel.loc}) +.data@2dffd88(size_without_padding=0,padding=101600,full_name=** symbol gap 3 (end of section),object_path=,source_path=,flags={}) +.bss@0(size_without_padding=262144,padding=0,full_name=ff_cos_131072,object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_float.o,source_path=third_party/fft_float.cc,flags={}) +.bss@0(size_without_padding=131072,padding=0,full_name=ff_cos_131072_fixed,object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_fixed.o,source_path=third_party/fft_fixed.cc,flags={}) +.bss@0(size_without_padding=131072,padding=0,full_name=ff_cos_65536,object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_float.o,source_path=third_party/fft_float.cc,flags={}) +.bss@2dffda0(size_without_padding=28,padding=0,full_name=g_chrome_content_browser_client,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen}) +.bss@2dffe80(size_without_padding=4,padding=196,full_name=SaveHistogram(_JNIEnv*, base::android::JavaParamRef<_jobject*> const&, base::android::JavaParamRef<_jstring*> const&, base::android::JavaParamRef<_jlongArray*> const&, int)::atomic_histogram_pointer,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen}) +.bss@2dffe84(size_without_padding=4,padding=0,full_name=g_AnimationFrameTimeHistogram_clazz,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={anon,gen})
diff --git a/tools/binary_size/libsupersize/testdata/Archive_OutputDirectory.golden b/tools/binary_size/libsupersize/testdata/Archive_OutputDirectory.golden index c905701..e35c477a7 100644 --- a/tools/binary_size/libsupersize/testdata/Archive_OutputDirectory.golden +++ b/tools/binary_size/libsupersize/testdata/Archive_OutputDirectory.golden
@@ -1,6 +1,6 @@ -Section r: has 100.0% of 5927652 bytes accounted for from 9 symbols. 0 bytes are unaccounted for. +Section r: has 100.0% of 5927652 bytes accounted for from 10 symbols. 0 bytes are unaccounted for. * Padding accounts for 11 bytes (0.0%) -* 4 placeholders (symbols that start with **) account for 5927509 bytes (100.0%) +* 5 placeholders (symbols that start with **) account for 5927509 bytes (100.0%) * 0 symbols have shared ownership Section b: has 40.3% of 524520 bytes accounted for from 6 symbols. 775936 bytes are unaccounted for. * Padding accounts for 196 bytes (0.0%) @@ -14,48 +14,49 @@ * 3 placeholders (symbols that start with **) account for 35830760 bytes (99.8%) * Contains 0 aliases * 0 symbols have shared ownership -.text@28d900(size_without_padding=16,padding=0,name=_GLOBAL__sub_I_page_allocator.cc,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={startup}) -.text@28d910(size_without_padding=56,padding=0,name=_GLOBAL__sub_I_bbr_sender.cc,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={startup}) -.text@28d948(size_without_padding=28,padding=0,name=_GLOBAL__sub_I_pacing_sender.cc,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={startup}) -.text@28d964(size_without_padding=38,padding=0,name=extFromUUseMapping,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) -.text@28d98a(size_without_padding=32,padding=0,name=extFromUUseMapping,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) -.text@28f000(size_without_padding=0,padding=5718,name=** symbol gap 0,object_path=,source_path=,flags={}) -.text@28f000(size_without_padding=448,padding=0,name=ucnv_extMatchFromU,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen}) -.text@28f1c8(size_without_padding=20,padding=8,name=_GLOBAL__sub_I_SkDeviceProfile.cpp,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={startup,gen}) -.text@28f1e0(size_without_padding=69120,padding=4,name=foo_bar,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={unlikely,gen}) -.text@2a0000(size_without_padding=16,padding=32,name=blink::ContiguousContainerBase::shrinkToFit,object_path=third_party/WebKit.a/PaintChunker.o,source_path=third_party/paint.cc,flags={}) -.text@2a0010(size_without_padding=12,padding=0,name=blink::ContiguousContainerBase::shrinkToFit [clone .part.1234] [clone .isra.2],object_path=third_party/WebKit.a/PaintChunker.o,source_path=third_party/paint.cc,flags={}) -.text@2a0020(size_without_padding=24,padding=4,name=blink::ContiguousContainerBase::ContiguousContainerBase,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={}) -.text@2a1000(size_without_padding=0,padding=4040,name=** symbol gap 1,object_path=,source_path=,flags={}) -.text@2a1000(size_without_padding=94,padding=0,name=blink::PaintChunker::releasePaintChunks [clone .part.1],object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={anon}) -.text@24ca628(size_without_padding=0,padding=35821002,name=** symbol gap 2 (end of section),object_path=,source_path=,flags={}) -.rodata@266e600(size_without_padding=1965409,padding=0,name=** merge strings,object_path=,source_path=,flags={}) -.rodata@284e364(size_without_padding=0,padding=3,name=** symbol gap 2,object_path=,source_path=,flags={}) -.rodata@284e364(size_without_padding=8,padding=0,name=,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) -.rodata@284e370(size_without_padding=40,padding=4,name=Name,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) -.rodata@284e398(size_without_padding=32,padding=0,name=chrome::mojom::FilePatcher::Name_,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={}) -.rodata@284e518(size_without_padding=675633,padding=352,name=** merge strings,object_path=,source_path=,flags={}) -.rodata@28f3450(size_without_padding=48,padding=7,name=kAnimationFrameTimeHistogramClassPath,object_path=third_party/WebKit.a/PaintChunker.o,source_path=third_party/paint.cc,flags={anon}) -.rodata@28f3480(size_without_padding=4,padding=0,name=blink::CSSValueKeywordsHash::findValueImpl::value_word_list,object_path=third_party/WebKit.a/PaintChunker.o,source_path=third_party/paint.cc,flags={anon}) -.rodata@2c158e4(size_without_padding=0,padding=3286112,name=** symbol gap 3 (end of section),object_path=,source_path=,flags={}) -.data.rel.ro.local@2c176f0(size_without_padding=56,padding=0,name=ChromeMainDelegate [vtable],object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen}) -.data.rel.ro.local@2c17728(size_without_padding=24,padding=0,name=chrome::mojom::FieldTrialRecorder [vtable],object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen}) -.data.rel.ro.local@2c17740(size_without_padding=789904,padding=0,name=chrome::mojom::FieldTrialRecorderProxy [vtable],object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={}) -.data.rel.ro.local@2cd84e0(size_without_padding=16,padding=16,name=.Lswitch.table.45,object_path=third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libcontroller_api_impl.a_controller_api_impl.o,source_path=,flags={}) -.data.rel.ro.local@2cd84f0(size_without_padding=8,padding=0,name=kSystemClassPrefixes,object_path=third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libport_android_jni.a_jni_utils.o,source_path=,flags={anon}) -.data.rel.ro@2cd8500(size_without_padding=56,padding=0,name=ChromeMainDelegateAndroid [vtable],object_path=third_party/WebKit.a/PaintChunker.o,source_path=third_party/paint.cc,flags={}) -.data.rel.ro@2cd8538(size_without_padding=24,padding=0,name=mojo::MessageReceiver [vtable],object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) -.data.rel.ro@2cd8550(size_without_padding=12,padding=0,name=kMethodsAnimationFrameTimeHistogram,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) -.data.rel.ro@2ddc608(size_without_padding=0,padding=1065132,name=** symbol gap 3 (end of section),object_path=,source_path=,flags={}) -.data@2de7000(size_without_padding=4,padding=0,name=google::protobuf::internal::pLinuxKernelCmpxchg,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) -.data@2de7004(size_without_padding=4,padding=0,name=google::protobuf::internal::pLinuxKernelMemoryBarrier,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={}) -.data@2de7008(size_without_padding=152,padding=0,name=base::android::kBaseRegisteredMethods,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={rel}) -.data@2de70a0(size_without_padding=4,padding=0,name=base::android::g_renderer_histogram_code,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={anon}) -.data@2de70a4(size_without_padding=4,padding=0,name=base::android::g_library_version_number,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={anon,rel.loc}) -.data@2dffd88(size_without_padding=0,padding=101600,name=** symbol gap 3 (end of section),object_path=,source_path=,flags={}) -.bss@0(size_without_padding=262144,padding=0,name=ff_cos_131072,object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_float.o,source_path=third_party/fft_float.cc,flags={}) -.bss@0(size_without_padding=131072,padding=0,name=ff_cos_131072_fixed,object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_fixed.o,source_path=third_party/fft_fixed.cc,flags={}) -.bss@0(size_without_padding=131072,padding=0,name=ff_cos_65536,object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_float.o,source_path=third_party/fft_float.cc,flags={}) -.bss@2dffda0(size_without_padding=28,padding=0,name=g_chrome_content_browser_client,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen}) -.bss@2dffe80(size_without_padding=4,padding=196,name=SaveHistogram::atomic_histogram_pointer,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen}) -.bss@2dffe84(size_without_padding=4,padding=0,name=g_AnimationFrameTimeHistogram_clazz,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={anon,gen}) +.text@28d900(size_without_padding=16,padding=0,full_name=_GLOBAL__sub_I_page_allocator.cc,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={startup}) +.text@28d910(size_without_padding=56,padding=0,full_name=_GLOBAL__sub_I_bbr_sender.cc,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={startup}) +.text@28d948(size_without_padding=28,padding=0,full_name=_GLOBAL__sub_I_pacing_sender.cc,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={startup}) +.text@28d964(size_without_padding=38,padding=0,full_name=extFromUUseMapping(signed char, unsigned int, int),object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) +.text@28d98a(size_without_padding=32,padding=0,full_name=extFromUUseMapping(aj, int),object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) +.text@28f000(size_without_padding=0,padding=5718,full_name=** symbol gap 0,object_path=,source_path=,flags={}) +.text@28f000(size_without_padding=448,padding=0,full_name=ucnv_extMatchFromU(int const*, int, unsigned short const*, int, unsigned short const*, int, unsigned int*, signed char, signed char),object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen}) +.text@28f1c8(size_without_padding=20,padding=8,full_name=_GLOBAL__sub_I_SkDeviceProfile.cpp,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={startup,gen}) +.text@28f1e0(size_without_padding=69120,padding=4,full_name=foo_bar,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={unlikely,gen}) +.text@2a0000(size_without_padding=16,padding=32,full_name=blink::ContiguousContainerBase::shrinkToFit(),object_path=third_party/WebKit.a/PaintChunker.o,source_path=third_party/paint.cc,flags={}) +.text@2a0010(size_without_padding=12,padding=0,full_name=blink::ContiguousContainerBase::shrinkToFit() [clone .part.1234] [clone .isra.2],object_path=third_party/WebKit.a/PaintChunker.o,source_path=third_party/paint.cc,flags={}) +.text@2a0020(size_without_padding=24,padding=4,full_name=blink::ContiguousContainerBase::ContiguousContainerBase(blink::ContiguousContainerBase&&),object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={}) +.text@2a1000(size_without_padding=0,padding=4040,full_name=** symbol gap 1,object_path=,source_path=,flags={}) +.text@2a1000(size_without_padding=94,padding=0,full_name=blink::PaintChunker::releasePaintChunks() [clone .part.1],object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={anon}) +.text@24ca628(size_without_padding=0,padding=35821002,full_name=** symbol gap 2 (end of section),object_path=,source_path=,flags={}) +.rodata@266e600(size_without_padding=1961984,padding=0,full_name=** merge strings,object_path=,source_path=,flags={}) +.rodata@284d600(size_without_padding=3425,padding=0,full_name=** merge constants,object_path=,source_path=,flags={}) +.rodata@284e364(size_without_padding=0,padding=3,full_name=** symbol gap 2,object_path=,source_path=,flags={}) +.rodata@284e364(size_without_padding=8,padding=0,full_name=,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) +.rodata@284e370(size_without_padding=40,padding=4,full_name=Name,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) +.rodata@284e398(size_without_padding=32,padding=0,full_name=chrome::mojom::FilePatcher::Name_,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={}) +.rodata@284e518(size_without_padding=675633,padding=352,full_name=** merge strings,object_path=,source_path=,flags={}) +.rodata@28f3450(size_without_padding=48,padding=7,full_name=kAnimationFrameTimeHistogramClassPath,object_path=third_party/WebKit.a/PaintChunker.o,source_path=third_party/paint.cc,flags={anon}) +.rodata@28f3480(size_without_padding=4,padding=0,full_name=blink::CSSValueKeywordsHash::findValueImpl(char const*, unsigned int)::value_word_list,object_path=third_party/WebKit.a/PaintChunker.o,source_path=third_party/paint.cc,flags={anon}) +.rodata@2c158e4(size_without_padding=0,padding=3286112,full_name=** symbol gap 3 (end of section),object_path=,source_path=,flags={}) +.data.rel.ro.local@2c176f0(size_without_padding=56,padding=0,full_name=ChromeMainDelegate [vtable],object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen}) +.data.rel.ro.local@2c17728(size_without_padding=24,padding=0,full_name=chrome::mojom::FieldTrialRecorder [vtable],object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen}) +.data.rel.ro.local@2c17740(size_without_padding=789904,padding=0,full_name=chrome::mojom::FieldTrialRecorderProxy [vtable],object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={}) +.data.rel.ro.local@2cd84e0(size_without_padding=16,padding=16,full_name=.Lswitch.table.45,object_path=third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libcontroller_api_impl.a_controller_api_impl.o,source_path=,flags={}) +.data.rel.ro.local@2cd84f0(size_without_padding=8,padding=0,full_name=kSystemClassPrefixes,object_path=third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libport_android_jni.a_jni_utils.o,source_path=,flags={anon}) +.data.rel.ro@2cd8500(size_without_padding=56,padding=0,full_name=ChromeMainDelegateAndroid [vtable],object_path=third_party/WebKit.a/PaintChunker.o,source_path=third_party/paint.cc,flags={}) +.data.rel.ro@2cd8538(size_without_padding=24,padding=0,full_name=mojo::MessageReceiver [vtable],object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) +.data.rel.ro@2cd8550(size_without_padding=12,padding=0,full_name=kMethodsAnimationFrameTimeHistogram,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) +.data.rel.ro@2ddc608(size_without_padding=0,padding=1065132,full_name=** symbol gap 3 (end of section),object_path=,source_path=,flags={}) +.data@2de7000(size_without_padding=4,padding=0,full_name=google::protobuf::internal::pLinuxKernelCmpxchg,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={}) +.data@2de7004(size_without_padding=4,padding=0,full_name=google::protobuf::internal::pLinuxKernelMemoryBarrier,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={}) +.data@2de7008(size_without_padding=152,padding=0,full_name=base::android::kBaseRegisteredMethods,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={rel}) +.data@2de70a0(size_without_padding=4,padding=0,full_name=base::android::g_renderer_histogram_code,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={anon}) +.data@2de70a4(size_without_padding=4,padding=0,full_name=base::android::g_library_version_number,object_path=third_party/WebKit.a/ContiguousContainer.o,source_path=third_party/container.c,flags={anon,rel.loc}) +.data@2dffd88(size_without_padding=0,padding=101600,full_name=** symbol gap 3 (end of section),object_path=,source_path=,flags={}) +.bss@0(size_without_padding=262144,padding=0,full_name=ff_cos_131072,object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_float.o,source_path=third_party/fft_float.cc,flags={}) +.bss@0(size_without_padding=131072,padding=0,full_name=ff_cos_131072_fixed,object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_fixed.o,source_path=third_party/fft_fixed.cc,flags={}) +.bss@0(size_without_padding=131072,padding=0,full_name=ff_cos_65536,object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_float.o,source_path=third_party/fft_float.cc,flags={}) +.bss@2dffda0(size_without_padding=28,padding=0,full_name=g_chrome_content_browser_client,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen}) +.bss@2dffe80(size_without_padding=4,padding=196,full_name=SaveHistogram(_JNIEnv*, base::android::JavaParamRef<_jobject*> const&, base::android::JavaParamRef<_jstring*> const&, base::android::JavaParamRef<_jlongArray*> const&, int)::atomic_histogram_pointer,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen}) +.bss@2dffe84(size_without_padding=4,padding=0,full_name=g_AnimationFrameTimeHistogram_clazz,object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={anon,gen})
diff --git a/tools/binary_size/libsupersize/testdata/Console.golden b/tools/binary_size/libsupersize/testdata/Console.golden index 881e6d9b..c8a315129 100644 --- a/tools/binary_size/libsupersize/testdata/Console.golden +++ b/tools/binary_size/libsupersize/testdata/Console.golden
@@ -64,7 +64,7 @@ .rodata: 5.65mb (5927652 bytes) (13.5%) .text: 34.2mb (35900712 bytes) (82.0%) -Showing 48 symbols (45 unique) with total pss: 43785380 bytes +Showing 49 symbols (46 unique) with total pss: 43785380 bytes .text=34.2mb .rodata=5.65mb .data*=1.87mb .bss=512kb total=41.8mb Number of object files: 10 @@ -106,62 +106,64 @@ blink::PaintChunker::releasePaintChunks [clone .part.1] 17) 35900712 (82.0%) t@0x24ca628 35821002 {no path} ** symbol gap 2 (end of section) -18) 37866121 (86.5%) r@0x266e600 1965409 {no path} +18) 37862696 (86.5%) r@0x266e600 1961984 {no path} ** merge strings -19) 37866124 (86.5%) r@0x284e364 3 {no path} +19) 37866121 (86.5%) r@0x284d600 3425 {no path} + ** merge constants +20) 37866124 (86.5%) r@0x284e364 3 {no path} ** symbol gap 2 -20) 37866132 (86.5%) r@0x284e364 8 base/page_allocator.cc -21) 37866176 (86.5%) r@0x284e370 44 base/page_allocator.cc +21) 37866132 (86.5%) r@0x284e364 8 base/page_allocator.cc +22) 37866176 (86.5%) r@0x284e370 44 base/page_allocator.cc Name -22) 37866208 (86.5%) r@0x284e398 32 third_party/container.c +23) 37866208 (86.5%) r@0x284e398 32 third_party/container.c chrome::mojom::FilePatcher::Name_ -23) 38542193 (88.0%) r@0x284e518 675985 {no path} +24) 38542193 (88.0%) r@0x284e518 675985 {no path} ** merge strings -24) 38542248 (88.0%) r@0x28f3450 55 third_party/paint.cc +25) 38542248 (88.0%) r@0x28f3450 55 third_party/paint.cc kAnimationFrameTimeHistogramClassPath -25) 38542252 (88.0%) r@0x28f3480 4 third_party/paint.cc +26) 38542252 (88.0%) r@0x28f3480 4 third_party/paint.cc blink::CSSValueKeywordsHash::findValueImpl::value_word_list -26) 41828364 (95.5%) r@0x2c158e4 3286112 {no path} +27) 41828364 (95.5%) r@0x2c158e4 3286112 {no path} ** symbol gap 3 (end of section) -27) 41828420 (95.5%) d@0x2c176f0 56 third_party/icu/ucnv_ext.c +28) 41828420 (95.5%) d@0x2c176f0 56 third_party/icu/ucnv_ext.c ChromeMainDelegate [vtable] -28) 41828444 (95.5%) d@0x2c17728 24 third_party/icu/ucnv_ext.c +29) 41828444 (95.5%) d@0x2c17728 24 third_party/icu/ucnv_ext.c chrome::mojom::FieldTrialRecorder [vtable] -29) 42618348 (97.3%) d@0x2c17740 789904 third_party/container.c +30) 42618348 (97.3%) d@0x2c17740 789904 third_party/container.c chrome::mojom::FieldTrialRecorderProxy [vtable] -30) 42618380 (97.3%) d@0x2cd84e0 32 third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libcontroller_api_impl.a_controller_api_impl.o +31) 42618380 (97.3%) d@0x2cd84e0 32 third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libcontroller_api_impl.a_controller_api_impl.o .Lswitch.table.45 -31) 42618388 (97.3%) d@0x2cd84f0 8 third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libport_android_jni.a_jni_utils.o +32) 42618388 (97.3%) d@0x2cd84f0 8 third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libport_android_jni.a_jni_utils.o kSystemClassPrefixes -32) 42618444 (97.3%) d@0x2cd8500 56 third_party/paint.cc +33) 42618444 (97.3%) d@0x2cd8500 56 third_party/paint.cc ChromeMainDelegateAndroid [vtable] -33) 42618468 (97.3%) d@0x2cd8538 24 base/page_allocator.cc +34) 42618468 (97.3%) d@0x2cd8538 24 base/page_allocator.cc mojo::MessageReceiver [vtable] -34) 42618480 (97.3%) d@0x2cd8550 12 base/page_allocator.cc +35) 42618480 (97.3%) d@0x2cd8550 12 base/page_allocator.cc kMethodsAnimationFrameTimeHistogram -35) 43683612 (99.8%) d@0x2ddc608 1065132 {no path} +36) 43683612 (99.8%) d@0x2ddc608 1065132 {no path} ** symbol gap 3 (end of section) -36) 43683616 (99.8%) d@0x2de7000 4 base/page_allocator.cc +37) 43683616 (99.8%) d@0x2de7000 4 base/page_allocator.cc google::protobuf::internal::pLinuxKernelCmpxchg -37) 43683620 (99.8%) d@0x2de7004 4 third_party/container.c +38) 43683620 (99.8%) d@0x2de7004 4 third_party/container.c google::protobuf::internal::pLinuxKernelMemoryBarrier -38) 43683772 (99.8%) d@0x2de7008 152 third_party/container.c +39) 43683772 (99.8%) d@0x2de7008 152 third_party/container.c base::android::kBaseRegisteredMethods -39) 43683776 (99.8%) d@0x2de70a0 4 third_party/container.c +40) 43683776 (99.8%) d@0x2de70a0 4 third_party/container.c base::android::g_renderer_histogram_code -40) 43683780 (99.8%) d@0x2de70a4 4 third_party/container.c +41) 43683780 (99.8%) d@0x2de70a4 4 third_party/container.c base::android::g_library_version_number -41) 43785380 (100.0%) d@0x2dffd88 101600 {no path} +42) 43785380 (100.0%) d@0x2dffd88 101600 {no path} ** symbol gap 3 (end of section) -42) 43785380 (100.0%) b@0x0 262144 third_party/fft_float.cc +43) 43785380 (100.0%) b@0x0 262144 third_party/fft_float.cc ff_cos_131072 -43) 43785380 (100.0%) b@0x0 131072 third_party/fft_fixed.cc +44) 43785380 (100.0%) b@0x0 131072 third_party/fft_fixed.cc ff_cos_131072_fixed -44) 43785380 (100.0%) b@0x0 131072 third_party/fft_float.cc +45) 43785380 (100.0%) b@0x0 131072 third_party/fft_float.cc ff_cos_65536 -45) 43785380 (100.0%) b@0x2dffda0 28 third_party/icu/ucnv_ext.c +46) 43785380 (100.0%) b@0x2dffda0 28 third_party/icu/ucnv_ext.c g_chrome_content_browser_client -46) 43785380 (100.0%) b@0x2dffe80 200 third_party/icu/ucnv_ext.c +47) 43785380 (100.0%) b@0x2dffe80 200 third_party/icu/ucnv_ext.c SaveHistogram::atomic_histogram_pointer -47) 43785380 (100.0%) b@0x2dffe84 4 third_party/icu/ucnv_ext.c +48) 43785380 (100.0%) b@0x2dffe84 4 third_party/icu/ucnv_ext.c g_AnimationFrameTimeHistogram_clazz
diff --git a/tools/binary_size/libsupersize/testdata/Diff_Basic.golden b/tools/binary_size/libsupersize/testdata/Diff_Basic.golden index a52ff178..44930f1d 100644 --- a/tools/binary_size/libsupersize/testdata/Diff_Basic.golden +++ b/tools/binary_size/libsupersize/testdata/Diff_Basic.golden
@@ -38,10 +38,10 @@ .strtab: 0 bytes (0 bytes) .symtab: 0 bytes (0 bytes) -2 symbols added (+), 1 changed (~), 3 removed (-), 34 unchanged (=) +2 symbols added (+), 1 changed (~), 3 removed (-), 35 unchanged (=) 0 object files added, 0 removed -Showing 40 symbols (40 unique) with total pss: 82 bytes +Showing 41 symbols (41 unique) with total pss: 82 bytes .text=82 bytes .rodata=0 bytes .data*=0 bytes .bss=-36 bytes total=82 bytes Number of object files: 9 @@ -59,118 +59,121 @@ full_name=extFromUUseMapping(signed char, unsigned int, int) = 3) 82 (100.0%) r@0x284e364 pss=0 padding=0 size_without_padding=0 source_path=base/page_allocator.cc object_path=base/base/page_allocator.o -= 4) 82 (100.0%) r@Group pss=0 padding=0 size_without_padding=0 count=2 += 4) 82 (100.0%) r@0x284d600 pss=0 padding=0 size_without_padding=0 + source_path= object_path= + flags={} name=** merge constants += 5) 82 (100.0%) r@Group pss=0 padding=0 size_without_padding=0 count=2 source_path= object_path= flags={} name=** merge strings -= 5) 82 (100.0%) d@0x2ddc608 pss=0 padding=0 size_without_padding=0 += 6) 82 (100.0%) d@0x2ddc608 pss=0 padding=0 size_without_padding=0 source_path= object_path= flags={} name=** symbol gap 3 (end of section) -= 6) 82 (100.0%) d@0x2dffd88 pss=0 padding=0 size_without_padding=0 += 7) 82 (100.0%) d@0x2dffd88 pss=0 padding=0 size_without_padding=0 source_path= object_path= flags={} name=** symbol gap 3 (end of section) -= 7) 82 (100.0%) t@Group pss=0 padding=0 size_without_padding=0 count=3 += 8) 82 (100.0%) t@Group pss=0 padding=0 size_without_padding=0 count=3 source_path= object_path= flags={} name=** symbol gaps -= 8) 82 (100.0%) r@Group pss=0 padding=0 size_without_padding=0 count=2 += 9) 82 (100.0%) r@Group pss=0 padding=0 size_without_padding=0 count=2 source_path= object_path= flags={} name=** symbol gaps -= 9) 82 (100.0%) d@0x2cd84e0 pss=0 padding=0 size_without_padding=0 += 10) 82 (100.0%) d@0x2cd84e0 pss=0 padding=0 size_without_padding=0 source_path= object_path=third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libcontroller_api_impl.a_controller_api_impl.o flags={} name=.Lswitch.table.45 -= 10) 82 (100.0%) d@0x2c176f0 pss=0 padding=0 size_without_padding=0 += 11) 82 (100.0%) d@0x2c176f0 pss=0 padding=0 size_without_padding=0 source_path=third_party/icu/ucnv_ext.c object_path=third_party/icu/icuuc/ucnv_ext.o flags={gen} name=ChromeMainDelegate [vtable] -= 11) 82 (100.0%) d@0x2cd8500 pss=0 padding=0 size_without_padding=0 += 12) 82 (100.0%) d@0x2cd8500 pss=0 padding=0 size_without_padding=0 source_path=third_party/paint.cc object_path=third_party/WebKit.a/PaintChunker.o flags={} name=ChromeMainDelegateAndroid [vtable] -= 12) 82 (100.0%) r@0x284e370 pss=0 padding=0 size_without_padding=0 += 13) 82 (100.0%) r@0x284e370 pss=0 padding=0 size_without_padding=0 source_path=base/page_allocator.cc object_path=base/base/page_allocator.o flags={} name=Name -= 13) 82 (100.0%) t@0x28f1c8 pss=0 padding=0 size_without_padding=0 += 14) 82 (100.0%) t@0x28f1c8 pss=0 padding=0 size_without_padding=0 source_path=third_party/icu/ucnv_ext.c object_path=third_party/icu/icuuc/ucnv_ext.o flags={startup,gen} name=_GLOBAL__sub_I_SkDeviceProfile.cpp -= 14) 82 (100.0%) t@0x28d948 pss=0 padding=0 size_without_padding=0 += 15) 82 (100.0%) t@0x28d948 pss=0 padding=0 size_without_padding=0 source_path=base/page_allocator.cc object_path=base/base/page_allocator.o flags={startup} name=_GLOBAL__sub_I_pacing_sender.cc -= 15) 82 (100.0%) d@0x2de70a4 pss=0 padding=0 size_without_padding=0 += 16) 82 (100.0%) d@0x2de70a4 pss=0 padding=0 size_without_padding=0 source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o flags={anon,rel.loc} name=base::android::g_library_version_number -= 16) 82 (100.0%) d@0x2de70a0 pss=0 padding=0 size_without_padding=0 += 17) 82 (100.0%) d@0x2de70a0 pss=0 padding=0 size_without_padding=0 source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o flags={anon} name=base::android::g_renderer_histogram_code -= 17) 82 (100.0%) d@0x2de7008 pss=0 padding=0 size_without_padding=0 += 18) 82 (100.0%) d@0x2de7008 pss=0 padding=0 size_without_padding=0 source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o flags={rel} name=base::android::kBaseRegisteredMethods -= 18) 82 (100.0%) r@0x28f3480 pss=0 padding=0 size_without_padding=0 += 19) 82 (100.0%) r@0x28f3480 pss=0 padding=0 size_without_padding=0 source_path=third_party/paint.cc object_path=third_party/WebKit.a/PaintChunker.o flags={anon} name=blink::CSSValueKeywordsHash::findValueImpl::value_word_list full_name=blink::CSSValueKeywordsHash::findValueImpl(char const*, unsigned int)::value_word_list -= 19) 82 (100.0%) t@0x2a0020 pss=0 padding=0 size_without_padding=0 += 20) 82 (100.0%) t@0x2a0020 pss=0 padding=0 size_without_padding=0 source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o flags={} name=blink::ContiguousContainerBase::ContiguousContainerBase full_name=blink::ContiguousContainerBase::ContiguousContainerBase(blink::ContiguousContainerBase&&) -= 20) 82 (100.0%) t@Group pss=0 padding=0 size_without_padding=0 count=2 += 21) 82 (100.0%) t@Group pss=0 padding=0 size_without_padding=0 count=2 source_path=third_party/paint.cc object_path=third_party/WebKit.a/PaintChunker.o flags={} name=blink::ContiguousContainerBase::shrinkToFit full_name=blink::ContiguousContainerBase::shrinkToFit() -= 21) 82 (100.0%) t@0x2a1000 pss=0 padding=0 size_without_padding=0 += 22) 82 (100.0%) t@0x2a1000 pss=0 padding=0 size_without_padding=0 source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o flags={anon} name=blink::PaintChunker::releasePaintChunks [clone .part.1] full_name=blink::PaintChunker::releasePaintChunks() [clone .part.1] -= 22) 82 (100.0%) d@0x2c17728 pss=0 padding=0 size_without_padding=0 += 23) 82 (100.0%) d@0x2c17728 pss=0 padding=0 size_without_padding=0 source_path=third_party/icu/ucnv_ext.c object_path=third_party/icu/icuuc/ucnv_ext.o flags={gen} name=chrome::mojom::FieldTrialRecorder [vtable] -= 23) 82 (100.0%) d@0x2c17740 pss=0 padding=0 size_without_padding=0 += 24) 82 (100.0%) d@0x2c17740 pss=0 padding=0 size_without_padding=0 source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o flags={} name=chrome::mojom::FieldTrialRecorderProxy [vtable] -= 24) 82 (100.0%) r@0x284e398 pss=0 padding=0 size_without_padding=0 += 25) 82 (100.0%) r@0x284e398 pss=0 padding=0 size_without_padding=0 source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o flags={} name=chrome::mojom::FilePatcher::Name_ -= 25) 82 (100.0%) t@0x28d98a pss=0 padding=0 size_without_padding=0 += 26) 82 (100.0%) t@0x28d98a pss=0 padding=0 size_without_padding=0 source_path=base/page_allocator.cc object_path=base/base/page_allocator.o flags={} name=extFromUUseMapping full_name=extFromUUseMapping(aj, int) -= 26) 82 (100.0%) t@0x28f1e0 pss=0 padding=0 size_without_padding=0 += 27) 82 (100.0%) t@0x28f1e0 pss=0 padding=0 size_without_padding=0 source_path=third_party/icu/ucnv_ext.c object_path=third_party/icu/icuuc/ucnv_ext.o flags={unlikely,gen} name=foo_bar -= 27) 82 (100.0%) d@0x2de7000 pss=0 padding=0 size_without_padding=0 += 28) 82 (100.0%) d@0x2de7000 pss=0 padding=0 size_without_padding=0 source_path=base/page_allocator.cc object_path=base/base/page_allocator.o flags={} name=google::protobuf::internal::pLinuxKernelCmpxchg -= 28) 82 (100.0%) d@0x2de7004 pss=0 padding=0 size_without_padding=0 += 29) 82 (100.0%) d@0x2de7004 pss=0 padding=0 size_without_padding=0 source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o flags={} name=google::protobuf::internal::pLinuxKernelMemoryBarrier -= 29) 82 (100.0%) r@0x28f3450 pss=0 padding=0 size_without_padding=0 += 30) 82 (100.0%) r@0x28f3450 pss=0 padding=0 size_without_padding=0 source_path=third_party/paint.cc object_path=third_party/WebKit.a/PaintChunker.o flags={anon} name=kAnimationFrameTimeHistogramClassPath -= 30) 82 (100.0%) d@0x2cd8550 pss=0 padding=0 size_without_padding=0 += 31) 82 (100.0%) d@0x2cd8550 pss=0 padding=0 size_without_padding=0 source_path=base/page_allocator.cc object_path=base/base/page_allocator.o flags={} name=kMethodsAnimationFrameTimeHistogram -= 31) 82 (100.0%) d@0x2cd84f0 pss=0 padding=0 size_without_padding=0 += 32) 82 (100.0%) d@0x2cd84f0 pss=0 padding=0 size_without_padding=0 source_path= object_path=third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libport_android_jni.a_jni_utils.o flags={anon} name=kSystemClassPrefixes -= 32) 82 (100.0%) d@0x2cd8538 pss=0 padding=0 size_without_padding=0 += 33) 82 (100.0%) d@0x2cd8538 pss=0 padding=0 size_without_padding=0 source_path=base/page_allocator.cc object_path=base/base/page_allocator.o flags={} name=mojo::MessageReceiver [vtable] -= 33) 82 (100.0%) t@0x28f000 pss=0 padding=0 size_without_padding=0 += 34) 82 (100.0%) t@0x28f000 pss=0 padding=0 size_without_padding=0 source_path=third_party/icu/ucnv_ext.c object_path=third_party/icu/icuuc/ucnv_ext.o flags={gen} name=ucnv_extMatchFromU full_name=ucnv_extMatchFromU(int const*, int, unsigned short const*, int, unsigned short const*, int, unsigned int*, signed char, signed char) -- 34) 82 (100.0%) b@0x2dffda0 pss=-28 padding=0 size_without_padding=-28 +- 35) 82 (100.0%) b@0x2dffda0 pss=-28 padding=0 size_without_padding=-28 source_path=third_party/icu/ucnv_ext.c object_path=third_party/icu/icuuc/ucnv_ext.o flags={gen} name=g_chrome_content_browser_client -- 35) 82 (100.0%) b@0x2dffe80 pss=-4 padding=-196 size_without_padding=192 +- 36) 82 (100.0%) b@0x2dffe80 pss=-4 padding=-196 size_without_padding=192 source_path=third_party/icu/ucnv_ext.c object_path=third_party/icu/icuuc/ucnv_ext.o flags={gen} name=SaveHistogram::atomic_histogram_pointer full_name=SaveHistogram(_JNIEnv*, base::android::JavaParamRef<_jobject*> const&, base::android::JavaParamRef<_jstring*> const&, base::android::JavaParamRef<_jlongArray*> const&, int)::atomic_histogram_pointer -- 36) 82 (100.0%) b@0x2dffe84 pss=-4 padding=0 size_without_padding=-4 +- 37) 82 (100.0%) b@0x2dffe84 pss=-4 padding=0 size_without_padding=-4 source_path=third_party/icu/ucnv_ext.c object_path=third_party/icu/icuuc/ucnv_ext.o flags={anon,gen} name=g_AnimationFrameTimeHistogram_clazz -= 37) 82 (100.0%) b@0x0 pss=0 padding=0 size_without_padding=0 += 38) 82 (100.0%) b@0x0 pss=0 padding=0 size_without_padding=0 source_path=third_party/fft_float.cc object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_float.o flags={} name=ff_cos_131072 -= 38) 82 (100.0%) b@0x0 pss=0 padding=0 size_without_padding=0 += 39) 82 (100.0%) b@0x0 pss=0 padding=0 size_without_padding=0 source_path=third_party/fft_fixed.cc object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_fixed.o flags={} name=ff_cos_131072_fixed -= 39) 82 (100.0%) b@0x0 pss=0 padding=0 size_without_padding=0 += 40) 82 (100.0%) b@0x0 pss=0 padding=0 size_without_padding=0 source_path=third_party/fft_float.cc object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_float.o flags={} name=ff_cos_65536
diff --git a/tools/binary_size/libsupersize/testdata/Diff_NullDiff.golden b/tools/binary_size/libsupersize/testdata/Diff_NullDiff.golden index 13d157b3..086a841 100644 --- a/tools/binary_size/libsupersize/testdata/Diff_NullDiff.golden +++ b/tools/binary_size/libsupersize/testdata/Diff_NullDiff.golden
@@ -18,7 +18,7 @@ .rodata: 0 bytes (0 bytes) (0.0%) .text: 0 bytes (0 bytes) (0.0%) -0 symbols added (+), 0 changed (~), 0 removed (-), 43 unchanged (not shown) +0 symbols added (+), 0 changed (~), 0 removed (-), 44 unchanged (not shown) 0 object files added, 0 removed Showing 0 symbols (0 unique) with total pss: 0 bytes
diff --git a/tools/binary_size/libsupersize/testdata/FullDescription.golden b/tools/binary_size/libsupersize/testdata/FullDescription.golden index 5f92eb1..f372b1dd 100644 --- a/tools/binary_size/libsupersize/testdata/FullDescription.golden +++ b/tools/binary_size/libsupersize/testdata/FullDescription.golden
@@ -40,9 +40,9 @@ .strtab: 33.2mb (34841854 bytes) .symtab: 16.4mb (17166112 bytes) -Section r: has 100.0% of 5927652 bytes accounted for from 9 symbols. 0 bytes are unaccounted for. +Section r: has 100.0% of 5927652 bytes accounted for from 10 symbols. 0 bytes are unaccounted for. * Padding accounts for 11 bytes (0.0%) -* 4 placeholders (symbols that start with **) account for 5927509 bytes (100.0%) +* 5 placeholders (symbols that start with **) account for 5927509 bytes (100.0%) * 0 symbols have shared ownership Section b: has 40.3% of 524520 bytes accounted for from 6 symbols. 775936 bytes are unaccounted for. * Padding accounts for 196 bytes (0.0%) @@ -57,7 +57,7 @@ * Contains 5 aliases, mapped to 2 unique addresses (60 bytes) * 1 symbols have shared ownership (12 bytes) -Showing 43 symbols (42 unique) with total pss: 43785380 bytes +Showing 44 symbols (43 unique) with total pss: 43785380 bytes .text=34.2mb .rodata=5.65mb .data*=1.87mb .bss=512kb total=41.8mb Number of object files: 10 @@ -134,16 +134,19 @@ source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o flags={anon} name=blink::PaintChunker::releasePaintChunks [clone .part.1] full_name=blink::PaintChunker::releasePaintChunks() [clone .part.1] -15) 38542106 (88.0%) r@Group pss=2641394 padding=352 size_without_padding=2641042 count=2 +15) 38538681 (88.0%) r@Group pss=2637969 padding=352 size_without_padding=2637617 count=2 source_path= object_path= flags={} name=** merge strings -> 0) 1965409 (74.4%) r@0x266e600 pss=1965409 padding=0 size_without_padding=1965409 +> 0) 1961984 (74.4%) r@0x266e600 pss=1961984 padding=0 size_without_padding=1961984 source_path= object_path= flags={} name=** merge strings -> 1) 2641394 (100.0%) r@0x284e518 pss=675985 padding=352 size_without_padding=675633 +> 1) 2637969 (100.0%) r@0x284e518 pss=675985 padding=352 size_without_padding=675633 source_path= object_path= flags={} name=** merge strings -16) 41828221 (95.5%) r@Group pss=3286115 padding=3286115 size_without_padding=0 count=2 +16) 38542106 (88.0%) r@0x284d600 pss=3425 padding=0 size_without_padding=3425 + source_path= object_path= + flags={} name=** merge constants +17) 41828221 (95.5%) r@Group pss=3286115 padding=3286115 size_without_padding=0 count=2 source_path= object_path= flags={} name=** symbol gaps > 0) 3 (0.0%) r@0x284e364 pss=3 padding=3 size_without_padding=0 @@ -152,82 +155,82 @@ > 1) 3286115 (100.0%) r@0x2c158e4 pss=3286112 padding=3286112 size_without_padding=0 source_path= object_path= flags={} name=** symbol gap 3 (end of section) -17) 41828229 (95.5%) r@0x284e364 pss=8 padding=0 size_without_padding=8 +18) 41828229 (95.5%) r@0x284e364 pss=8 padding=0 size_without_padding=8 source_path=base/page_allocator.cc object_path=base/base/page_allocator.o -18) 41828273 (95.5%) r@0x284e370 pss=44 padding=4 size_without_padding=40 +19) 41828273 (95.5%) r@0x284e370 pss=44 padding=4 size_without_padding=40 source_path=base/page_allocator.cc object_path=base/base/page_allocator.o flags={} name=Name -19) 41828305 (95.5%) r@0x284e398 pss=32 padding=0 size_without_padding=32 +20) 41828305 (95.5%) r@0x284e398 pss=32 padding=0 size_without_padding=32 source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o flags={} name=chrome::mojom::FilePatcher::Name_ -20) 41828360 (95.5%) r@0x28f3450 pss=55 padding=7 size_without_padding=48 +21) 41828360 (95.5%) r@0x28f3450 pss=55 padding=7 size_without_padding=48 source_path=third_party/paint.cc object_path=third_party/WebKit.a/PaintChunker.o flags={anon} name=kAnimationFrameTimeHistogramClassPath -21) 41828364 (95.5%) r@0x28f3480 pss=4 padding=0 size_without_padding=4 +22) 41828364 (95.5%) r@0x28f3480 pss=4 padding=0 size_without_padding=4 source_path=third_party/paint.cc object_path=third_party/WebKit.a/PaintChunker.o flags={anon} name=blink::CSSValueKeywordsHash::findValueImpl::value_word_list full_name=blink::CSSValueKeywordsHash::findValueImpl(char const*, unsigned int)::value_word_list -22) 41828420 (95.5%) d@0x2c176f0 pss=56 padding=0 size_without_padding=56 +23) 41828420 (95.5%) d@0x2c176f0 pss=56 padding=0 size_without_padding=56 source_path=third_party/icu/ucnv_ext.c object_path=third_party/icu/icuuc/ucnv_ext.o flags={gen} name=ChromeMainDelegate [vtable] -23) 41828444 (95.5%) d@0x2c17728 pss=24 padding=0 size_without_padding=24 +24) 41828444 (95.5%) d@0x2c17728 pss=24 padding=0 size_without_padding=24 source_path=third_party/icu/ucnv_ext.c object_path=third_party/icu/icuuc/ucnv_ext.o flags={gen} name=chrome::mojom::FieldTrialRecorder [vtable] -24) 42618348 (97.3%) d@0x2c17740 pss=789904 padding=0 size_without_padding=789904 +25) 42618348 (97.3%) d@0x2c17740 pss=789904 padding=0 size_without_padding=789904 source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o flags={} name=chrome::mojom::FieldTrialRecorderProxy [vtable] -25) 42618380 (97.3%) d@0x2cd84e0 pss=32 padding=16 size_without_padding=16 +26) 42618380 (97.3%) d@0x2cd84e0 pss=32 padding=16 size_without_padding=16 source_path= object_path=third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libcontroller_api_impl.a_controller_api_impl.o flags={} name=.Lswitch.table.45 -26) 42618388 (97.3%) d@0x2cd84f0 pss=8 padding=0 size_without_padding=8 +27) 42618388 (97.3%) d@0x2cd84f0 pss=8 padding=0 size_without_padding=8 source_path= object_path=third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libport_android_jni.a_jni_utils.o flags={anon} name=kSystemClassPrefixes -27) 42618444 (97.3%) d@0x2cd8500 pss=56 padding=0 size_without_padding=56 +28) 42618444 (97.3%) d@0x2cd8500 pss=56 padding=0 size_without_padding=56 source_path=third_party/paint.cc object_path=third_party/WebKit.a/PaintChunker.o flags={} name=ChromeMainDelegateAndroid [vtable] -28) 42618468 (97.3%) d@0x2cd8538 pss=24 padding=0 size_without_padding=24 +29) 42618468 (97.3%) d@0x2cd8538 pss=24 padding=0 size_without_padding=24 source_path=base/page_allocator.cc object_path=base/base/page_allocator.o flags={} name=mojo::MessageReceiver [vtable] -29) 42618480 (97.3%) d@0x2cd8550 pss=12 padding=0 size_without_padding=12 +30) 42618480 (97.3%) d@0x2cd8550 pss=12 padding=0 size_without_padding=12 source_path=base/page_allocator.cc object_path=base/base/page_allocator.o flags={} name=kMethodsAnimationFrameTimeHistogram -30) 43683612 (99.8%) d@0x2ddc608 pss=1065132 padding=1065132 size_without_padding=0 +31) 43683612 (99.8%) d@0x2ddc608 pss=1065132 padding=1065132 size_without_padding=0 source_path= object_path= flags={} name=** symbol gap 3 (end of section) -31) 43683616 (99.8%) d@0x2de7000 pss=4 padding=0 size_without_padding=4 +32) 43683616 (99.8%) d@0x2de7000 pss=4 padding=0 size_without_padding=4 source_path=base/page_allocator.cc object_path=base/base/page_allocator.o flags={} name=google::protobuf::internal::pLinuxKernelCmpxchg -32) 43683620 (99.8%) d@0x2de7004 pss=4 padding=0 size_without_padding=4 +33) 43683620 (99.8%) d@0x2de7004 pss=4 padding=0 size_without_padding=4 source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o flags={} name=google::protobuf::internal::pLinuxKernelMemoryBarrier -33) 43683772 (99.8%) d@0x2de7008 pss=152 padding=0 size_without_padding=152 +34) 43683772 (99.8%) d@0x2de7008 pss=152 padding=0 size_without_padding=152 source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o flags={rel} name=base::android::kBaseRegisteredMethods -34) 43683776 (99.8%) d@0x2de70a0 pss=4 padding=0 size_without_padding=4 +35) 43683776 (99.8%) d@0x2de70a0 pss=4 padding=0 size_without_padding=4 source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o flags={anon} name=base::android::g_renderer_histogram_code -35) 43683780 (99.8%) d@0x2de70a4 pss=4 padding=0 size_without_padding=4 +36) 43683780 (99.8%) d@0x2de70a4 pss=4 padding=0 size_without_padding=4 source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o flags={anon,rel.loc} name=base::android::g_library_version_number -36) 43785380 (100.0%) d@0x2dffd88 pss=101600 padding=101600 size_without_padding=0 +37) 43785380 (100.0%) d@0x2dffd88 pss=101600 padding=101600 size_without_padding=0 source_path= object_path= flags={} name=** symbol gap 3 (end of section) -37) 43785380 (100.0%) b@0x0 pss=262144 padding=0 size_without_padding=262144 +38) 43785380 (100.0%) b@0x0 pss=262144 padding=0 size_without_padding=262144 source_path=third_party/fft_float.cc object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_float.o flags={} name=ff_cos_131072 -38) 43785380 (100.0%) b@0x0 pss=131072 padding=0 size_without_padding=131072 +39) 43785380 (100.0%) b@0x0 pss=131072 padding=0 size_without_padding=131072 source_path=third_party/fft_fixed.cc object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_fixed.o flags={} name=ff_cos_131072_fixed -39) 43785380 (100.0%) b@0x0 pss=131072 padding=0 size_without_padding=131072 +40) 43785380 (100.0%) b@0x0 pss=131072 padding=0 size_without_padding=131072 source_path=third_party/fft_float.cc object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_float.o flags={} name=ff_cos_65536 -40) 43785380 (100.0%) b@0x2dffda0 pss=28 padding=0 size_without_padding=28 +41) 43785380 (100.0%) b@0x2dffda0 pss=28 padding=0 size_without_padding=28 source_path=third_party/icu/ucnv_ext.c object_path=third_party/icu/icuuc/ucnv_ext.o flags={gen} name=g_chrome_content_browser_client -41) 43785380 (100.0%) b@0x2dffe80 pss=200 padding=196 size_without_padding=4 +42) 43785380 (100.0%) b@0x2dffe80 pss=200 padding=196 size_without_padding=4 source_path=third_party/icu/ucnv_ext.c object_path=third_party/icu/icuuc/ucnv_ext.o flags={gen} name=SaveHistogram::atomic_histogram_pointer full_name=SaveHistogram(_JNIEnv*, base::android::JavaParamRef<_jobject*> const&, base::android::JavaParamRef<_jstring*> const&, base::android::JavaParamRef<_jlongArray*> const&, int)::atomic_histogram_pointer -42) 43785380 (100.0%) b@0x2dffe84 pss=4 padding=0 size_without_padding=4 +43) 43785380 (100.0%) b@0x2dffe84 pss=4 padding=0 size_without_padding=4 source_path=third_party/icu/ucnv_ext.c object_path=third_party/icu/icuuc/ucnv_ext.o flags={anon,gen} name=g_AnimationFrameTimeHistogram_clazz
diff --git a/tools/binary_size/libsupersize/testdata/SymbolGroupMethods.golden b/tools/binary_size/libsupersize/testdata/SymbolGroupMethods.golden index 7356a27b..c3459e2a 100644 --- a/tools/binary_size/libsupersize/testdata/SymbolGroupMethods.golden +++ b/tools/binary_size/libsupersize/testdata/SymbolGroupMethods.golden
@@ -1,5 +1,5 @@ GroupedByName() -Showing 44 symbols (44 unique) with total pss: 43785380 bytes +Showing 45 symbols (45 unique) with total pss: 43785380 bytes .text=34.2mb .rodata=5.65mb .data*=1.87mb .bss=512kb total=41.8mb Number of object files: 10 @@ -13,44 +13,45 @@ 5) 224 (0.0%) *@Group 4 blink::CSSValueKeywordsHash::findValueImpl::value_word_list (count=1) 6) 294 (0.0%) *@Group 70 extFromUUseMapping (count=2) 7) 294 (0.0%) *@Group 0 ff_cos_131072_fixed (count=1) -8) 2641688 (6.0%) *@Group 2641394 ** merge strings (count=2) -9) 2641700 (6.0%) *@Group 12 kMethodsAnimationFrameTimeHistogram (count=1) -10) 2641756 (6.0%) *@Group 56 ChromeMainDelegate [vtable] (count=1) -11) 2641784 (6.0%) *@Group 28 blink::ContiguousContainerBase::ContiguousContainerBase (count=1) -12) 2641792 (6.0%) *@Group 8 kSystemClassPrefixes (count=1) -13) 7094636 (16.2%) *@Group 4452844 ** symbol gap 3 (end of section) (count=3) -14) 7094660 (16.2%) *@Group 24 blink::ContiguousContainerBase::shrinkToFit (count=1) -15) 7163784 (16.4%) *@Group 69124 foo_bar (count=1) -16) 7163784 (16.4%) *@Group 0 SaveHistogram::atomic_histogram_pointer (count=1) -17) 7163788 (16.4%) *@Group 4 base::android::g_renderer_histogram_code (count=1) -18) 7163791 (16.4%) *@Group 3 ** symbol gap 2 (count=1) -19) 7167831 (16.4%) *@Group 4040 ** symbol gap 1 (count=1) -20) 7173549 (16.4%) *@Group 5718 ** symbol gap 0 (count=1) -21) 7173549 (16.4%) *@Group 0 g_AnimationFrameTimeHistogram_clazz (count=1) -22) 7173553 (16.4%) *@Group 4 google::protobuf::internal::pLinuxKernelCmpxchg (count=1) -23) 7173577 (16.4%) *@Group 24 mojo::MessageReceiver [vtable] (count=1) -24) 7173621 (16.4%) *@Group 44 Name (count=1) -25) 7173625 (16.4%) *@Group 4 base::android::g_library_version_number (count=1) -26) 7963529 (18.2%) *@Group 789904 chrome::mojom::FieldTrialRecorderProxy [vtable] (count=1) -27) 7963553 (18.2%) *@Group 24 BazAlias (count=1) -28) 43784555 (100.0%) *@Group 35821002 ** symbol gap 2 (end of section) (count=1) -29) 43784555 (100.0%) *@Group 0 ff_cos_131072 (count=1) -30) 43784555 (100.0%) *@Group 0 g_chrome_content_browser_client (count=1) -31) 43784579 (100.0%) *@Group 24 chrome::mojom::FieldTrialRecorder [vtable] (count=1) -32) 43784583 (100.0%) *@Group 4 blink::ContiguousContainerBase::shrinkToFit [clone .part.1234] [clone .isra.2] (count=1) -33) 43784677 (100.0%) *@Group 94 blink::PaintChunker::releasePaintChunks [clone .part.1] (count=1) -34) 43784732 (100.0%) *@Group 55 kAnimationFrameTimeHistogramClassPath (count=1) -35) 43784764 (100.0%) *@Group 32 chrome::mojom::FilePatcher::Name_ (count=1) -36) 43784792 (100.0%) *@Group 28 _GLOBAL__sub_I_SkDeviceProfile.cpp (count=1) -37) 43784796 (100.0%) *@Group 4 google::protobuf::internal::pLinuxKernelMemoryBarrier (count=1) -38) 43784852 (100.0%) *@Group 56 ChromeMainDelegateAndroid [vtable] (count=1) -39) 43784884 (100.0%) *@Group 32 .Lswitch.table.45 (count=1) -40) 43784888 (100.0%) *@Group 4 FooAlias (count=1) -41) 43784904 (100.0%) *@Group 16 _GLOBAL__sub_I_page_allocator.cc (count=1) -42) 43785352 (100.0%) *@Group 448 ucnv_extMatchFromU (count=1) -43) 43785380 (100.0%) *@Group 28 _GLOBAL__sub_I_pacing_sender.cc (count=1) +8) 2638263 (6.0%) *@Group 2637969 ** merge strings (count=2) +9) 2638275 (6.0%) *@Group 12 kMethodsAnimationFrameTimeHistogram (count=1) +10) 2638331 (6.0%) *@Group 56 ChromeMainDelegate [vtable] (count=1) +11) 2638359 (6.0%) *@Group 28 blink::ContiguousContainerBase::ContiguousContainerBase (count=1) +12) 2638367 (6.0%) *@Group 8 kSystemClassPrefixes (count=1) +13) 7091211 (16.2%) *@Group 4452844 ** symbol gap 3 (end of section) (count=3) +14) 7091235 (16.2%) *@Group 24 blink::ContiguousContainerBase::shrinkToFit (count=1) +15) 7160359 (16.4%) *@Group 69124 foo_bar (count=1) +16) 7160359 (16.4%) *@Group 0 SaveHistogram::atomic_histogram_pointer (count=1) +17) 7160453 (16.4%) *@Group 94 blink::PaintChunker::releasePaintChunks [clone .part.1] (count=1) +18) 7160457 (16.4%) *@Group 4 base::android::g_renderer_histogram_code (count=1) +19) 7160460 (16.4%) *@Group 3 ** symbol gap 2 (count=1) +20) 7164500 (16.4%) *@Group 4040 ** symbol gap 1 (count=1) +21) 7170218 (16.4%) *@Group 5718 ** symbol gap 0 (count=1) +22) 7170218 (16.4%) *@Group 0 g_AnimationFrameTimeHistogram_clazz (count=1) +23) 7170222 (16.4%) *@Group 4 google::protobuf::internal::pLinuxKernelCmpxchg (count=1) +24) 7170246 (16.4%) *@Group 24 mojo::MessageReceiver [vtable] (count=1) +25) 7170290 (16.4%) *@Group 44 Name (count=1) +26) 7170294 (16.4%) *@Group 4 base::android::g_library_version_number (count=1) +27) 7960198 (18.2%) *@Group 789904 chrome::mojom::FieldTrialRecorderProxy [vtable] (count=1) +28) 7960222 (18.2%) *@Group 24 BazAlias (count=1) +29) 43781224 (100.0%) *@Group 35821002 ** symbol gap 2 (end of section) (count=1) +30) 43781224 (100.0%) *@Group 0 ff_cos_131072 (count=1) +31) 43781224 (100.0%) *@Group 0 g_chrome_content_browser_client (count=1) +32) 43781248 (100.0%) *@Group 24 chrome::mojom::FieldTrialRecorder [vtable] (count=1) +33) 43781252 (100.0%) *@Group 4 blink::ContiguousContainerBase::shrinkToFit [clone .part.1234] [clone .isra.2] (count=1) +34) 43784677 (100.0%) *@Group 3425 ** merge constants (count=1) +35) 43784732 (100.0%) *@Group 55 kAnimationFrameTimeHistogramClassPath (count=1) +36) 43784764 (100.0%) *@Group 32 chrome::mojom::FilePatcher::Name_ (count=1) +37) 43784792 (100.0%) *@Group 28 _GLOBAL__sub_I_SkDeviceProfile.cpp (count=1) +38) 43784796 (100.0%) *@Group 4 google::protobuf::internal::pLinuxKernelMemoryBarrier (count=1) +39) 43784852 (100.0%) *@Group 56 ChromeMainDelegateAndroid [vtable] (count=1) +40) 43784884 (100.0%) *@Group 32 .Lswitch.table.45 (count=1) +41) 43784888 (100.0%) *@Group 4 FooAlias (count=1) +42) 43784904 (100.0%) *@Group 16 _GLOBAL__sub_I_page_allocator.cc (count=1) +43) 43785352 (100.0%) *@Group 448 ucnv_extMatchFromU (count=1) +44) 43785380 (100.0%) *@Group 28 _GLOBAL__sub_I_pacing_sender.cc (count=1) GroupedByName(depth=1) -Showing 35 symbols (35 unique) with total pss: 43785380 bytes +Showing 36 symbols (36 unique) with total pss: 43785380 bytes .text=34.2mb .rodata=5.65mb .data*=1.87mb .bss=512kb total=41.8mb Number of object files: 10 @@ -64,35 +65,36 @@ 5) 146 (0.0%) *@Group 70 extFromUUseMapping (count=2) 6) 146 (0.0%) *@Group 0 SaveHistogram (count=1) 7) 300 (0.0%) *@Group 154 blink (count=5) -8) 2641694 (6.0%) *@Group 2641394 ** merge strings (count=2) -9) 2641706 (6.0%) *@Group 12 kMethodsAnimationFrameTimeHistogram (count=1) -10) 2641730 (6.0%) *@Group 24 mojo (count=1) -11) 2641786 (6.0%) *@Group 56 ChromeMainDelegate [vtable] (count=1) -12) 2641794 (6.0%) *@Group 8 kSystemClassPrefixes (count=1) -13) 7094638 (16.2%) *@Group 4452844 ** symbol gap 3 (end of section) (count=3) -14) 7094638 (16.2%) *@Group 0 ff_cos_131072 (count=1) -15) 7884598 (18.0%) *@Group 789960 chrome (count=3) -16) 7953722 (18.2%) *@Group 69124 foo_bar (count=1) -17) 7953722 (18.2%) *@Group 0 g_AnimationFrameTimeHistogram_clazz (count=1) -18) 7953725 (18.2%) *@Group 3 ** symbol gap 2 (count=1) -19) 7957765 (18.2%) *@Group 4040 ** symbol gap 1 (count=1) -20) 7963483 (18.2%) *@Group 5718 ** symbol gap 0 (count=1) -21) 7963527 (18.2%) *@Group 44 Name (count=1) -22) 7963551 (18.2%) *@Group 24 BazAlias (count=1) -23) 43784553 (100.0%) *@Group 35821002 ** symbol gap 2 (end of section) (count=1) -24) 43784713 (100.0%) *@Group 160 base (count=3) -25) 43784713 (100.0%) *@Group 0 g_chrome_content_browser_client (count=1) -26) 43784713 (100.0%) *@Group 0 ff_cos_131072_fixed (count=1) -27) 43784768 (100.0%) *@Group 55 kAnimationFrameTimeHistogramClassPath (count=1) -28) 43784796 (100.0%) *@Group 28 _GLOBAL__sub_I_SkDeviceProfile.cpp (count=1) -29) 43784852 (100.0%) *@Group 56 ChromeMainDelegateAndroid [vtable] (count=1) -30) 43784884 (100.0%) *@Group 32 .Lswitch.table.45 (count=1) -31) 43784888 (100.0%) *@Group 4 FooAlias (count=1) -32) 43784904 (100.0%) *@Group 16 _GLOBAL__sub_I_page_allocator.cc (count=1) -33) 43785352 (100.0%) *@Group 448 ucnv_extMatchFromU (count=1) -34) 43785380 (100.0%) *@Group 28 _GLOBAL__sub_I_pacing_sender.cc (count=1) +8) 2638269 (6.0%) *@Group 2637969 ** merge strings (count=2) +9) 2638281 (6.0%) *@Group 12 kMethodsAnimationFrameTimeHistogram (count=1) +10) 2638305 (6.0%) *@Group 24 mojo (count=1) +11) 2638361 (6.0%) *@Group 56 ChromeMainDelegate [vtable] (count=1) +12) 2638369 (6.0%) *@Group 8 kSystemClassPrefixes (count=1) +13) 7091213 (16.2%) *@Group 4452844 ** symbol gap 3 (end of section) (count=3) +14) 7091213 (16.2%) *@Group 0 ff_cos_131072 (count=1) +15) 7881173 (18.0%) *@Group 789960 chrome (count=3) +16) 7950297 (18.2%) *@Group 69124 foo_bar (count=1) +17) 7950297 (18.2%) *@Group 0 g_AnimationFrameTimeHistogram_clazz (count=1) +18) 7950300 (18.2%) *@Group 3 ** symbol gap 2 (count=1) +19) 7954340 (18.2%) *@Group 4040 ** symbol gap 1 (count=1) +20) 7960058 (18.2%) *@Group 5718 ** symbol gap 0 (count=1) +21) 7960102 (18.2%) *@Group 44 Name (count=1) +22) 7960126 (18.2%) *@Group 24 BazAlias (count=1) +23) 43781128 (100.0%) *@Group 35821002 ** symbol gap 2 (end of section) (count=1) +24) 43781288 (100.0%) *@Group 160 base (count=3) +25) 43781288 (100.0%) *@Group 0 g_chrome_content_browser_client (count=1) +26) 43781288 (100.0%) *@Group 0 ff_cos_131072_fixed (count=1) +27) 43784713 (100.0%) *@Group 3425 ** merge constants (count=1) +28) 43784768 (100.0%) *@Group 55 kAnimationFrameTimeHistogramClassPath (count=1) +29) 43784796 (100.0%) *@Group 28 _GLOBAL__sub_I_SkDeviceProfile.cpp (count=1) +30) 43784852 (100.0%) *@Group 56 ChromeMainDelegateAndroid [vtable] (count=1) +31) 43784884 (100.0%) *@Group 32 .Lswitch.table.45 (count=1) +32) 43784888 (100.0%) *@Group 4 FooAlias (count=1) +33) 43784904 (100.0%) *@Group 16 _GLOBAL__sub_I_page_allocator.cc (count=1) +34) 43785352 (100.0%) *@Group 448 ucnv_extMatchFromU (count=1) +35) 43785380 (100.0%) *@Group 28 _GLOBAL__sub_I_pacing_sender.cc (count=1) GroupedByName(depth=-1) -Showing 38 symbols (38 unique) with total pss: 43785380 bytes +Showing 39 symbols (39 unique) with total pss: 43785380 bytes .text=34.2mb .rodata=5.65mb .data*=1.87mb .bss=512kb total=41.8mb Number of object files: 10 @@ -105,39 +107,40 @@ 4) 138 (0.0%) *@Group 70 extFromUUseMapping (count=2) 5) 138 (0.0%) *@Group 0 SaveHistogram (count=1) 6) 170 (0.0%) *@Group 32 chrome::mojom::FilePatcher (count=1) -7) 2641564 (6.0%) *@Group 2641394 ** merge strings (count=2) -8) 2641564 (6.0%) *@Group 0 ff_cos_131072_fixed (count=1) -9) 2641576 (6.0%) *@Group 12 kMethodsAnimationFrameTimeHistogram (count=1) -10) 2641600 (6.0%) *@Group 24 mojo (count=1) -11) 2641656 (6.0%) *@Group 56 ChromeMainDelegate [vtable] (count=1) -12) 2641664 (6.0%) *@Group 8 kSystemClassPrefixes (count=1) -13) 7094508 (16.2%) *@Group 4452844 ** symbol gap 3 (end of section) (count=3) -14) 7094508 (16.2%) *@Group 0 ff_cos_131072 (count=1) -15) 7163632 (16.4%) *@Group 69124 foo_bar (count=1) -16) 7163632 (16.4%) *@Group 0 g_AnimationFrameTimeHistogram_clazz (count=1) -17) 7163635 (16.4%) *@Group 3 ** symbol gap 2 (count=1) -18) 7167675 (16.4%) *@Group 4040 ** symbol gap 1 (count=1) -19) 7173393 (16.4%) *@Group 5718 ** symbol gap 0 (count=1) -20) 7173397 (16.4%) *@Group 4 blink::CSSValueKeywordsHash::findValueImpl (count=1) -21) 7173441 (16.4%) *@Group 44 Name (count=1) -22) 7173601 (16.4%) *@Group 160 base::android (count=3) -23) 7173625 (16.4%) *@Group 24 BazAlias (count=1) -24) 42994627 (98.2%) *@Group 35821002 ** symbol gap 2 (end of section) (count=1) -25) 42994627 (98.2%) *@Group 0 g_chrome_content_browser_client (count=1) -26) 42994683 (98.2%) *@Group 56 blink::ContiguousContainerBase (count=3) -27) 42994777 (98.2%) *@Group 94 blink::PaintChunker (count=1) -28) 42994832 (98.2%) *@Group 55 kAnimationFrameTimeHistogramClassPath (count=1) -29) 42994860 (98.2%) *@Group 28 _GLOBAL__sub_I_SkDeviceProfile.cpp (count=1) -30) 43784788 (100.0%) *@Group 789928 chrome::mojom (count=2) -31) 43784844 (100.0%) *@Group 56 ChromeMainDelegateAndroid [vtable] (count=1) -32) 43784876 (100.0%) *@Group 32 .Lswitch.table.45 (count=1) -33) 43784884 (100.0%) *@Group 8 google::protobuf::internal (count=2) -34) 43784888 (100.0%) *@Group 4 FooAlias (count=1) -35) 43784904 (100.0%) *@Group 16 _GLOBAL__sub_I_page_allocator.cc (count=1) -36) 43785352 (100.0%) *@Group 448 ucnv_extMatchFromU (count=1) -37) 43785380 (100.0%) *@Group 28 _GLOBAL__sub_I_pacing_sender.cc (count=1) +7) 2638139 (6.0%) *@Group 2637969 ** merge strings (count=2) +8) 2638139 (6.0%) *@Group 0 ff_cos_131072_fixed (count=1) +9) 2638151 (6.0%) *@Group 12 kMethodsAnimationFrameTimeHistogram (count=1) +10) 2638175 (6.0%) *@Group 24 mojo (count=1) +11) 2638231 (6.0%) *@Group 56 ChromeMainDelegate [vtable] (count=1) +12) 2638239 (6.0%) *@Group 8 kSystemClassPrefixes (count=1) +13) 7091083 (16.2%) *@Group 4452844 ** symbol gap 3 (end of section) (count=3) +14) 7091083 (16.2%) *@Group 0 ff_cos_131072 (count=1) +15) 7160207 (16.4%) *@Group 69124 foo_bar (count=1) +16) 7160207 (16.4%) *@Group 0 g_AnimationFrameTimeHistogram_clazz (count=1) +17) 7160210 (16.4%) *@Group 3 ** symbol gap 2 (count=1) +18) 7164250 (16.4%) *@Group 4040 ** symbol gap 1 (count=1) +19) 7169968 (16.4%) *@Group 5718 ** symbol gap 0 (count=1) +20) 7169972 (16.4%) *@Group 4 blink::CSSValueKeywordsHash::findValueImpl (count=1) +21) 7170016 (16.4%) *@Group 44 Name (count=1) +22) 7170176 (16.4%) *@Group 160 base::android (count=3) +23) 7170200 (16.4%) *@Group 24 BazAlias (count=1) +24) 42991202 (98.2%) *@Group 35821002 ** symbol gap 2 (end of section) (count=1) +25) 42991202 (98.2%) *@Group 0 g_chrome_content_browser_client (count=1) +26) 42991258 (98.2%) *@Group 56 blink::ContiguousContainerBase (count=3) +27) 42991352 (98.2%) *@Group 94 blink::PaintChunker (count=1) +28) 42994777 (98.2%) *@Group 3425 ** merge constants (count=1) +29) 42994832 (98.2%) *@Group 55 kAnimationFrameTimeHistogramClassPath (count=1) +30) 42994860 (98.2%) *@Group 28 _GLOBAL__sub_I_SkDeviceProfile.cpp (count=1) +31) 43784788 (100.0%) *@Group 789928 chrome::mojom (count=2) +32) 43784844 (100.0%) *@Group 56 ChromeMainDelegateAndroid [vtable] (count=1) +33) 43784876 (100.0%) *@Group 32 .Lswitch.table.45 (count=1) +34) 43784884 (100.0%) *@Group 8 google::protobuf::internal (count=2) +35) 43784888 (100.0%) *@Group 4 FooAlias (count=1) +36) 43784904 (100.0%) *@Group 16 _GLOBAL__sub_I_page_allocator.cc (count=1) +37) 43785352 (100.0%) *@Group 448 ucnv_extMatchFromU (count=1) +38) 43785380 (100.0%) *@Group 28 _GLOBAL__sub_I_pacing_sender.cc (count=1) GroupedByName(depth=1, min_count=2) -Showing 35 symbols (34 unique) with total pss: 43785380 bytes +Showing 36 symbols (35 unique) with total pss: 43785380 bytes .text=34.2mb .rodata=5.65mb .data*=1.87mb .bss=512kb total=41.8mb Number of object files: 10 @@ -158,57 +161,59 @@ SaveHistogram::atomic_histogram_pointer 7) 300 (0.0%) *@Group 154 {no path} blink (count=5) -8) 2641694 (6.0%) *@Group 2641394 {no path} +8) 2638269 (6.0%) *@Group 2637969 {no path} ** merge strings (count=2) -9) 2641706 (6.0%) d@0x2cd8550 12 base/page_allocator.cc +9) 2638281 (6.0%) d@0x2cd8550 12 base/page_allocator.cc kMethodsAnimationFrameTimeHistogram -10) 2641730 (6.0%) d@0x2cd8538 24 base/page_allocator.cc +10) 2638305 (6.0%) d@0x2cd8538 24 base/page_allocator.cc mojo::MessageReceiver [vtable] -11) 2641786 (6.0%) d@0x2c176f0 56 third_party/icu/ucnv_ext.c +11) 2638361 (6.0%) d@0x2c176f0 56 third_party/icu/ucnv_ext.c ChromeMainDelegate [vtable] -12) 2641794 (6.0%) d@0x2cd84f0 8 third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libport_android_jni.a_jni_utils.o +12) 2638369 (6.0%) d@0x2cd84f0 8 third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libport_android_jni.a_jni_utils.o kSystemClassPrefixes -13) 7094638 (16.2%) *@Group 4452844 {no path} +13) 7091213 (16.2%) *@Group 4452844 {no path} ** symbol gap 3 (end of section) (count=3) -14) 7094638 (16.2%) b@0x0 262144 third_party/fft_float.cc +14) 7091213 (16.2%) b@0x0 262144 third_party/fft_float.cc ff_cos_131072 -15) 7884598 (18.0%) *@Group 789960 {no path} +15) 7881173 (18.0%) *@Group 789960 {no path} chrome (count=3) -16) 7953722 (18.2%) t@0x28f1e0 69124 third_party/icu/ucnv_ext.c +16) 7950297 (18.2%) t@0x28f1e0 69124 third_party/icu/ucnv_ext.c foo_bar -17) 7953722 (18.2%) b@0x2dffe84 4 third_party/icu/ucnv_ext.c +17) 7950297 (18.2%) b@0x2dffe84 4 third_party/icu/ucnv_ext.c g_AnimationFrameTimeHistogram_clazz -18) 7953725 (18.2%) r@0x284e364 3 {no path} +18) 7950300 (18.2%) r@0x284e364 3 {no path} ** symbol gap 2 -19) 7957765 (18.2%) t@0x2a1000 4040 {no path} +19) 7954340 (18.2%) t@0x2a1000 4040 {no path} ** symbol gap 1 -20) 7963483 (18.2%) t@0x28f000 5718 {no path} +20) 7960058 (18.2%) t@0x28f000 5718 {no path} ** symbol gap 0 -21) 7963527 (18.2%) r@0x284e370 44 base/page_allocator.cc +21) 7960102 (18.2%) r@0x284e370 44 base/page_allocator.cc Name -22) 7963551 (18.2%) t@0x2a0000 24 third_party/icu/ucnv_ext.c +22) 7960126 (18.2%) t@0x2a0000 24 third_party/icu/ucnv_ext.c BazAlias -23) 43784553 (100.0%) t@0x24ca628 35821002 {no path} +23) 43781128 (100.0%) t@0x24ca628 35821002 {no path} ** symbol gap 2 (end of section) -24) 43784713 (100.0%) *@Group 160 third_party/container.c +24) 43781288 (100.0%) *@Group 160 third_party/container.c base (count=3) -25) 43784713 (100.0%) b@0x2dffda0 28 third_party/icu/ucnv_ext.c +25) 43781288 (100.0%) b@0x2dffda0 28 third_party/icu/ucnv_ext.c g_chrome_content_browser_client -26) 43784713 (100.0%) b@0x0 131072 third_party/fft_fixed.cc +26) 43781288 (100.0%) b@0x0 131072 third_party/fft_fixed.cc ff_cos_131072_fixed -27) 43784768 (100.0%) r@0x28f3450 55 third_party/paint.cc +27) 43784713 (100.0%) r@0x284d600 3425 {no path} + ** merge constants +28) 43784768 (100.0%) r@0x28f3450 55 third_party/paint.cc kAnimationFrameTimeHistogramClassPath -28) 43784796 (100.0%) t@0x28f1c8 28 third_party/icu/ucnv_ext.c +29) 43784796 (100.0%) t@0x28f1c8 28 third_party/icu/ucnv_ext.c _GLOBAL__sub_I_SkDeviceProfile.cpp -29) 43784852 (100.0%) d@0x2cd8500 56 third_party/paint.cc +30) 43784852 (100.0%) d@0x2cd8500 56 third_party/paint.cc ChromeMainDelegateAndroid [vtable] -30) 43784884 (100.0%) d@0x2cd84e0 32 third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libcontroller_api_impl.a_controller_api_impl.o +31) 43784884 (100.0%) d@0x2cd84e0 32 third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libcontroller_api_impl.a_controller_api_impl.o .Lswitch.table.45 -31) 43784888 (100.0%) t@0x2a0010 4 third_party/fft_float.cc +32) 43784888 (100.0%) t@0x2a0010 4 third_party/fft_float.cc FooAlias -32) 43784904 (100.0%) t@0x28d900 16 base/page_allocator.cc +33) 43784904 (100.0%) t@0x28d900 16 base/page_allocator.cc _GLOBAL__sub_I_page_allocator.cc -33) 43785352 (100.0%) t@0x28f000 448 third_party/icu/ucnv_ext.c +34) 43785352 (100.0%) t@0x28f000 448 third_party/icu/ucnv_ext.c ucnv_extMatchFromU -34) 43785380 (100.0%) t@0x28d948 28 base/page_allocator.cc +35) 43785380 (100.0%) t@0x28d948 28 base/page_allocator.cc _GLOBAL__sub_I_pacing_sender.cc
diff --git a/tools/binary_size/libsupersize/testdata/mock_toolchain/mock_nm.py b/tools/binary_size/libsupersize/testdata/mock_toolchain/mock_nm.py index 85edc80..9472569 100644 --- a/tools/binary_size/libsupersize/testdata/mock_toolchain/mock_nm.py +++ b/tools/binary_size/libsupersize/testdata/mock_toolchain/mock_nm.py
@@ -9,7 +9,7 @@ _SHRINK_TO_FIT_CLONE = ('blink::ContiguousContainerBase::shrinkToFit() ' '[clone .part.1234] [clone .isra.2]') _ELF_OUTPUT = """002b6e20 t $t -00000010 N $d +00000010 N 002b6bb8 t $t 002a0010 t {} 0028d900 t startup._GLOBAL__sub_I_page_allocator.cc @@ -88,7 +88,7 @@ '01010101 d .Lswitch.table.45', '', 'libport_android_jni.a_jni_utils.o:', - '(anonymous namespace)::kSystemClassPrefixes', + '01010101 t (anonymous namespace)::kSystemClassPrefixes', ], }
diff --git a/tools/binary_size/libsupersize/testdata/test.map b/tools/binary_size/libsupersize/testdata/test.map index adebd5c..890e80e5 100644 --- a/tools/binary_size/libsupersize/testdata/test.map +++ b/tools/binary_size/libsupersize/testdata/test.map
@@ -113,7 +113,9 @@ .rodata 0x0266e600 0x5a72e4 ** merge strings - 0x0266e600 0x1dfd61 + 0x0266e600 0x1df000 + ** merge constants + 0x0284d600 0xd61 .rodata 0x0284e364 0x8 obj/base/base/page_allocator.o .rodata.Name 0x0284e370 0x28 obj/base/base/page_allocator.o
diff --git a/tools/perf/benchmark.csv b/tools/perf/benchmark.csv index 903a4a9..b040b25 100644 --- a/tools/perf/benchmark.csv +++ b/tools/perf/benchmark.csv
@@ -160,7 +160,6 @@ v8.infinite_scroll-classic_tbmv2,hablich@chromium.org, v8.infinite_scroll-turbo_tbmv2,mvstaton@chromium.org, v8.infinite_scroll_tbmv2,ulan@chromium.org, -v8.key_mobile_sites_smooth,"hpayer@chromium.org, rmcilroy@chromium.org", v8.mobile_infinite_scroll-classic_tbmv2,hablich@chromium.org, v8.mobile_infinite_scroll-turbo_tbmv2,mvstaton@chromium.org, v8.mobile_infinite_scroll_tbmv2,ulan@chromium.org, @@ -171,7 +170,6 @@ v8.runtimestats.browsing_mobile,mythria@chromium.org, v8.runtimestats.browsing_mobile_classic,hablich@chromium.org, v8.runtimestats.browsing_mobile_turbo,mythria@chromium.org, -v8.top_25_smooth,"hpayer@chromium.org, rmcilroy@chromium.org", webrtc.datachannel,phoglund@chromium.org, webrtc.getusermedia,, webrtc.peerconnection,,
diff --git a/tools/perf/benchmarks/v8.py b/tools/perf/benchmarks/v8.py index bccdd689..5ca5cde 100644 --- a/tools/perf/benchmarks/v8.py +++ b/tools/perf/benchmarks/v8.py
@@ -10,7 +10,6 @@ from benchmarks import v8_helper from measurements import v8_detached_context_age_in_gc -from measurements import v8_gc_times import page_sets from telemetry import benchmark from telemetry import story @@ -29,34 +28,6 @@ return options -@benchmark.Disabled('win') # crbug.com/416502 -@benchmark.Owner(emails=['hpayer@chromium.org', 'rmcilroy@chromium.org']) -class V8Top25(perf_benchmark.PerfBenchmark): - """Measures V8 GC metrics on the while scrolling down the top 25 web pages. - - http://www.chromium.org/developers/design-documents/rendering-benchmarks""" - test = v8_gc_times.V8GCTimes - page_set = page_sets.V8Top25SmoothPageSet - - @classmethod - def Name(cls): - return 'v8.top_25_smooth' - - -@benchmark.Enabled('android') -@benchmark.Owner(emails=['hpayer@chromium.org', 'rmcilroy@chromium.org']) -class V8KeyMobileSites(perf_benchmark.PerfBenchmark): - """Measures V8 GC metrics on the while scrolling down key mobile sites. - - http://www.chromium.org/developers/design-documents/rendering-benchmarks""" - test = v8_gc_times.V8GCTimes - page_set = page_sets.KeyMobileSitesSmoothPageSet - - @classmethod - def Name(cls): - return 'v8.key_mobile_sites_smooth' - - @benchmark.Owner(emails=['ulan@chromium.org']) class V8DetachedContextAgeInGC(perf_benchmark.PerfBenchmark): """Measures the number of GCs needed to collect a detached context.
diff --git a/tools/perf/page_sets/system_health/browsing_stories.py b/tools/perf/page_sets/system_health/browsing_stories.py index 75ba50a2..e949881 100644 --- a/tools/perf/page_sets/system_health/browsing_stories.py +++ b/tools/perf/page_sets/system_health/browsing_stories.py
@@ -199,6 +199,7 @@ SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY +@decorators.Disabled('mac') # crbug.com/722094 class TwitterMobileStory(_ArticleBrowsingStory): NAME = 'browse:social:twitter' URL = 'https://www.twitter.com/nasa'
diff --git a/ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc b/ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc index 90fa7c20..f568752 100644 --- a/ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc +++ b/ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc
@@ -8,9 +8,9 @@ #undef None #undef Bool -#include "base/message_loop/message_loop.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" +#include "base/test/scoped_task_environment.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/dragdrop/file_info.h" #include "ui/events/platform/x11/x11_event_source_glib.h" @@ -25,7 +25,10 @@ class OSExchangeDataProviderAuraX11Test : public testing::Test { public: - OSExchangeDataProviderAuraX11Test() : event_source(gfx::GetXDisplay()) {} + OSExchangeDataProviderAuraX11Test() + : scoped_task_environment_( + base::test::ScopedTaskEnvironment::MainThreadType::UI), + event_source(gfx::GetXDisplay()) {} void AddURLList(const std::string& list_contents) { std::string contents_copy = list_contents; @@ -38,7 +41,7 @@ } protected: - base::MessageLoopForUI message_loop; + base::test::ScopedTaskEnvironment scoped_task_environment_; X11EventSourceGlib event_source; ui::OSExchangeDataProviderAuraX11 provider; };
diff --git a/ui/compositor/test/test_suite.cc b/ui/compositor/test/test_suite.cc index c315a574..b9ec38b 100644 --- a/ui/compositor/test/test_suite.cc +++ b/ui/compositor/test/test_suite.cc
@@ -5,7 +5,8 @@ #include "ui/compositor/test/test_suite.h" #include "base/command_line.h" -#include "base/message_loop/message_loop.h" +#include "base/memory/ptr_util.h" +#include "base/test/scoped_task_environment.h" #include "build/build_config.h" #include "ui/compositor/compositor.h" #include "ui/compositor/compositor_switches.h" @@ -43,11 +44,13 @@ display::win::SetDefaultDeviceScaleFactor(1.0f); #endif - message_loop_.reset(new base::MessageLoopForUI); + scoped_task_environment_ = + base::MakeUnique<base::test::ScopedTaskEnvironment>( + base::test::ScopedTaskEnvironment::MainThreadType::UI); } void CompositorTestSuite::Shutdown() { - message_loop_.reset(); + scoped_task_environment_.reset(); base::TestSuite::Shutdown(); }
diff --git a/ui/compositor/test/test_suite.h b/ui/compositor/test/test_suite.h index 09ab669..5bc015c7 100644 --- a/ui/compositor/test/test_suite.h +++ b/ui/compositor/test/test_suite.h
@@ -12,7 +12,9 @@ #include "base/test/test_suite.h" namespace base { -class MessageLoop; +namespace test { +class ScopedTaskEnvironment; +} } namespace ui { @@ -29,7 +31,7 @@ void Shutdown() override; private: - std::unique_ptr<base::MessageLoop> message_loop_; + std::unique_ptr<base::test::ScopedTaskEnvironment> scoped_task_environment_; DISALLOW_COPY_AND_ASSIGN(CompositorTestSuite); };
diff --git a/ui/events/platform/x11/x11_hotplug_event_handler.cc b/ui/events/platform/x11/x11_hotplug_event_handler.cc index be7bb09..f011c73a 100644 --- a/ui/events/platform/x11/x11_hotplug_event_handler.cc +++ b/ui/events/platform/x11/x11_hotplug_event_handler.cc
@@ -23,8 +23,8 @@ #include "base/single_thread_task_runner.h" #include "base/strings/string_util.h" #include "base/sys_info.h" +#include "base/task_scheduler/post_task.h" #include "base/threading/thread_task_runner_handle.h" -#include "base/threading/worker_pool.h" #include "ui/events/devices/device_data_manager.h" #include "ui/events/devices/device_hotplug_event_observer.h" #include "ui/events/devices/device_util_linux.h" @@ -493,14 +493,14 @@ callbacks.touchpad_callback = base::Bind(&OnTouchpadDevices); callbacks.hotplug_finished_callback = base::Bind(&OnHotplugFinished); - // Parsing the device information may block, so delegate the operation to a - // worker thread. Once the device information is extracted the parsed devices - // will be returned via the callbacks. - base::WorkerPool::PostTask( + // Parse the device information asynchronously since this operation may block. + // Once the device information is extracted the parsed devices will be + // returned via the callbacks. + base::PostTaskWithTraits( FROM_HERE, - base::Bind(&HandleHotplugEventInWorker, device_infos, display_state, - base::ThreadTaskRunnerHandle::Get(), callbacks), - true /* task_is_slow */); + {base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, + base::BindOnce(&HandleHotplugEventInWorker, device_infos, display_state, + base::ThreadTaskRunnerHandle::Get(), callbacks)); } } // namespace ui
diff --git a/ui/ozone/platform/drm/gpu/drm_thread.cc b/ui/ozone/platform/drm/gpu/drm_thread.cc index cc0a455..9bd3555 100644 --- a/ui/ozone/platform/drm/gpu/drm_thread.cc +++ b/ui/ozone/platform/drm/gpu/drm_thread.cc
@@ -218,41 +218,42 @@ void DrmThread::CheckOverlayCapabilities( gfx::AcceleratedWidget widget, const std::vector<OverlayCheck_Params>& overlays, - const base::Callback<void(gfx::AcceleratedWidget, - const std::vector<OverlayCheck_Params>&)>& + base::OnceCallback<void(gfx::AcceleratedWidget, + const std::vector<OverlayCheck_Params>&)> callback) { - callback.Run(widget, - screen_manager_->GetWindow(widget)->TestPageFlip(overlays)); + std::move(callback).Run( + widget, screen_manager_->GetWindow(widget)->TestPageFlip(overlays)); } void DrmThread::RefreshNativeDisplays( - const base::Callback<void(const std::vector<DisplaySnapshot_Params>&)>& + base::OnceCallback<void(const std::vector<DisplaySnapshot_Params>&)> callback) { - callback.Run(display_manager_->GetDisplays()); + std::move(callback).Run(display_manager_->GetDisplays()); } void DrmThread::ConfigureNativeDisplay( int64_t id, const DisplayMode_Params& mode, const gfx::Point& origin, - const base::Callback<void(int64_t, bool)>& callback) { - callback.Run(id, display_manager_->ConfigureDisplay(id, mode, origin)); + base::OnceCallback<void(int64_t, bool)> callback) { + std::move(callback).Run(id, + display_manager_->ConfigureDisplay(id, mode, origin)); } void DrmThread::DisableNativeDisplay( int64_t id, - const base::Callback<void(int64_t, bool)>& callback) { - callback.Run(id, display_manager_->DisableDisplay(id)); + base::OnceCallback<void(int64_t, bool)> callback) { + std::move(callback).Run(id, display_manager_->DisableDisplay(id)); } -void DrmThread::TakeDisplayControl(const base::Callback<void(bool)>& callback) { - callback.Run(display_manager_->TakeDisplayControl()); +void DrmThread::TakeDisplayControl(base::OnceCallback<void(bool)> callback) { + std::move(callback).Run(display_manager_->TakeDisplayControl()); } void DrmThread::RelinquishDisplayControl( - const base::Callback<void(bool)>& callback) { + base::OnceCallback<void(bool)> callback) { display_manager_->RelinquishDisplayControl(); - callback.Run(true); + std::move(callback).Run(true); } void DrmThread::AddGraphicsDevice(const base::FilePath& path, @@ -266,17 +267,17 @@ void DrmThread::GetHDCPState( int64_t display_id, - const base::Callback<void(int64_t, bool, display::HDCPState)>& callback) { + base::OnceCallback<void(int64_t, bool, display::HDCPState)> callback) { display::HDCPState state = display::HDCP_STATE_UNDESIRED; bool success = display_manager_->GetHDCPState(display_id, &state); - callback.Run(display_id, success, state); + std::move(callback).Run(display_id, success, state); } -void DrmThread::SetHDCPState( - int64_t display_id, - display::HDCPState state, - const base::Callback<void(int64_t, bool)>& callback) { - callback.Run(display_id, display_manager_->SetHDCPState(display_id, state)); +void DrmThread::SetHDCPState(int64_t display_id, + display::HDCPState state, + base::OnceCallback<void(int64_t, bool)> callback) { + std::move(callback).Run(display_id, + display_manager_->SetHDCPState(display_id, state)); } void DrmThread::SetColorCorrection(
diff --git a/ui/ozone/platform/drm/gpu/drm_thread.h b/ui/ozone/platform/drm/gpu/drm_thread.h index be12617..045d917 100644 --- a/ui/ozone/platform/drm/gpu/drm_thread.h +++ b/ui/ozone/platform/drm/gpu/drm_thread.h
@@ -92,31 +92,29 @@ void CheckOverlayCapabilities( gfx::AcceleratedWidget widget, const std::vector<OverlayCheck_Params>& overlays, - const base::Callback<void(gfx::AcceleratedWidget, - const std::vector<OverlayCheck_Params>&)>& + base::OnceCallback<void(gfx::AcceleratedWidget, + const std::vector<OverlayCheck_Params>&)> callback); void RefreshNativeDisplays( - const base::Callback<void(const std::vector<DisplaySnapshot_Params>&)>& + base::OnceCallback<void(const std::vector<DisplaySnapshot_Params>&)> callback); - void ConfigureNativeDisplay( - int64_t id, - const DisplayMode_Params& mode, - const gfx::Point& origin, - const base::Callback<void(int64_t, bool)>& callback); - void DisableNativeDisplay( - int64_t id, - const base::Callback<void(int64_t, bool)>& callback); - void TakeDisplayControl(const base::Callback<void(bool)>& callback); - void RelinquishDisplayControl(const base::Callback<void(bool)>& callback); + void ConfigureNativeDisplay(int64_t id, + const DisplayMode_Params& mode, + const gfx::Point& origin, + base::OnceCallback<void(int64_t, bool)> callback); + void DisableNativeDisplay(int64_t id, + base::OnceCallback<void(int64_t, bool)> callback); + void TakeDisplayControl(base::OnceCallback<void(bool)> callback); + void RelinquishDisplayControl(base::OnceCallback<void(bool)> callback); void AddGraphicsDevice(const base::FilePath& path, const base::FileDescriptor& fd); void RemoveGraphicsDevice(const base::FilePath& path); void GetHDCPState( int64_t display_id, - const base::Callback<void(int64_t, bool, display::HDCPState)>& callback); + base::OnceCallback<void(int64_t, bool, display::HDCPState)> callback); void SetHDCPState(int64_t display_id, display::HDCPState state, - const base::Callback<void(int64_t, bool)>& callback); + base::OnceCallback<void(int64_t, bool)> callback); void SetColorCorrection( int64_t display_id, const std::vector<display::GammaRampRGBEntry>& degamma_lut,
diff --git a/ui/ozone/platform/drm/gpu/drm_thread_message_proxy.cc b/ui/ozone/platform/drm/gpu/drm_thread_message_proxy.cc index fe1211da..18ccede4 100644 --- a/ui/ozone/platform/drm/gpu/drm_thread_message_proxy.cc +++ b/ui/ozone/platform/drm/gpu/drm_thread_message_proxy.cc
@@ -109,23 +109,26 @@ const std::vector<OverlayCheck_Params>& overlays) { DCHECK(drm_thread_->IsRunning()); auto callback = - base::Bind(&DrmThreadMessageProxy::OnCheckOverlayCapabilitiesCallback, - weak_ptr_factory_.GetWeakPtr()); + base::BindOnce(&DrmThreadMessageProxy::OnCheckOverlayCapabilitiesCallback, + weak_ptr_factory_.GetWeakPtr()); + + auto safe_callback = CreateSafeOnceCallback(std::move(callback)); drm_thread_->task_runner()->PostTask( - FROM_HERE, base::Bind(&DrmThread::CheckOverlayCapabilities, - base::Unretained(drm_thread_), widget, overlays, - CreateSafeCallback(callback))); + FROM_HERE, base::BindOnce(&DrmThread::CheckOverlayCapabilities, + base::Unretained(drm_thread_), widget, overlays, + std::move(safe_callback))); } void DrmThreadMessageProxy::OnRefreshNativeDisplays() { DCHECK(drm_thread_->IsRunning()); auto callback = - base::Bind(&DrmThreadMessageProxy::OnRefreshNativeDisplaysCallback, - weak_ptr_factory_.GetWeakPtr()); + base::BindOnce(&DrmThreadMessageProxy::OnRefreshNativeDisplaysCallback, + weak_ptr_factory_.GetWeakPtr()); + auto safe_callback = CreateSafeOnceCallback(std::move(callback)); drm_thread_->task_runner()->PostTask( FROM_HERE, - base::Bind(&DrmThread::RefreshNativeDisplays, - base::Unretained(drm_thread_), CreateSafeCallback(callback))); + base::BindOnce(&DrmThread::RefreshNativeDisplays, + base::Unretained(drm_thread_), std::move(safe_callback))); } void DrmThreadMessageProxy::OnConfigureNativeDisplay( @@ -134,45 +137,49 @@ const gfx::Point& origin) { DCHECK(drm_thread_->IsRunning()); auto callback = - base::Bind(&DrmThreadMessageProxy::OnConfigureNativeDisplayCallback, - weak_ptr_factory_.GetWeakPtr()); + base::BindOnce(&DrmThreadMessageProxy::OnConfigureNativeDisplayCallback, + weak_ptr_factory_.GetWeakPtr()); + auto safe_callback = CreateSafeOnceCallback(std::move(callback)); drm_thread_->task_runner()->PostTask( - FROM_HERE, base::Bind(&DrmThread::ConfigureNativeDisplay, - base::Unretained(drm_thread_), id, mode, origin, - CreateSafeCallback(callback))); + FROM_HERE, base::BindOnce(&DrmThread::ConfigureNativeDisplay, + base::Unretained(drm_thread_), id, mode, origin, + std::move(safe_callback))); } void DrmThreadMessageProxy::OnDisableNativeDisplay(int64_t id) { DCHECK(drm_thread_->IsRunning()); auto callback = - base::Bind(&DrmThreadMessageProxy::OnDisableNativeDisplayCallback, - weak_ptr_factory_.GetWeakPtr()); + base::BindOnce(&DrmThreadMessageProxy::OnDisableNativeDisplayCallback, + weak_ptr_factory_.GetWeakPtr()); + auto safe_callback = CreateSafeOnceCallback(std::move(callback)); drm_thread_->task_runner()->PostTask( - FROM_HERE, base::Bind(&DrmThread::DisableNativeDisplay, - base::Unretained(drm_thread_), id, - CreateSafeCallback(callback))); + FROM_HERE, base::BindOnce(&DrmThread::DisableNativeDisplay, + base::Unretained(drm_thread_), id, + std::move(safe_callback))); } void DrmThreadMessageProxy::OnTakeDisplayControl() { DCHECK(drm_thread_->IsRunning()); auto callback = - base::Bind(&DrmThreadMessageProxy::OnTakeDisplayControlCallback, - weak_ptr_factory_.GetWeakPtr()); + base::BindOnce(&DrmThreadMessageProxy::OnTakeDisplayControlCallback, + weak_ptr_factory_.GetWeakPtr()); + auto safe_callback = CreateSafeOnceCallback(std::move(callback)); drm_thread_->task_runner()->PostTask( FROM_HERE, - base::Bind(&DrmThread::TakeDisplayControl, base::Unretained(drm_thread_), - CreateSafeCallback(callback))); + base::BindOnce(&DrmThread::TakeDisplayControl, + base::Unretained(drm_thread_), std::move(safe_callback))); } void DrmThreadMessageProxy::OnRelinquishDisplayControl() { DCHECK(drm_thread_->IsRunning()); auto callback = - base::Bind(&DrmThreadMessageProxy::OnRelinquishDisplayControlCallback, - weak_ptr_factory_.GetWeakPtr()); + base::BindOnce(&DrmThreadMessageProxy::OnRelinquishDisplayControlCallback, + weak_ptr_factory_.GetWeakPtr()); + auto safe_callback = CreateSafeOnceCallback(std::move(callback)); drm_thread_->task_runner()->PostTask( FROM_HERE, - base::Bind(&DrmThread::RelinquishDisplayControl, - base::Unretained(drm_thread_), CreateSafeCallback(callback))); + base::BindOnce(&DrmThread::RelinquishDisplayControl, + base::Unretained(drm_thread_), std::move(safe_callback))); } void DrmThreadMessageProxy::OnAddGraphicsDevice( @@ -193,23 +200,25 @@ void DrmThreadMessageProxy::OnGetHDCPState(int64_t display_id) { DCHECK(drm_thread_->IsRunning()); - auto callback = base::Bind(&DrmThreadMessageProxy::OnGetHDCPStateCallback, - weak_ptr_factory_.GetWeakPtr()); + auto callback = base::BindOnce(&DrmThreadMessageProxy::OnGetHDCPStateCallback, + weak_ptr_factory_.GetWeakPtr()); + auto safe_callback = CreateSafeOnceCallback(std::move(callback)); drm_thread_->task_runner()->PostTask( FROM_HERE, - base::Bind(&DrmThread::GetHDCPState, base::Unretained(drm_thread_), - display_id, CreateSafeCallback(callback))); + base::BindOnce(&DrmThread::GetHDCPState, base::Unretained(drm_thread_), + display_id, std::move(safe_callback))); } void DrmThreadMessageProxy::OnSetHDCPState(int64_t display_id, display::HDCPState state) { DCHECK(drm_thread_->IsRunning()); - auto callback = base::Bind(&DrmThreadMessageProxy::OnSetHDCPStateCallback, - weak_ptr_factory_.GetWeakPtr()); + auto callback = base::BindOnce(&DrmThreadMessageProxy::OnSetHDCPStateCallback, + weak_ptr_factory_.GetWeakPtr()); + auto safe_callback = CreateSafeOnceCallback(std::move(callback)); drm_thread_->task_runner()->PostTask( FROM_HERE, - base::Bind(&DrmThread::SetHDCPState, base::Unretained(drm_thread_), - display_id, state, CreateSafeCallback(callback))); + base::BindOnce(&DrmThread::SetHDCPState, base::Unretained(drm_thread_), + display_id, state, std::move(safe_callback))); } void DrmThreadMessageProxy::OnSetColorCorrection(
diff --git a/ui/ozone/platform/drm/mus_thread_proxy.cc b/ui/ozone/platform/drm/mus_thread_proxy.cc index ad701e4e..204c1fd 100644 --- a/ui/ozone/platform/drm/mus_thread_proxy.cc +++ b/ui/ozone/platform/drm/mus_thread_proxy.cc
@@ -186,24 +186,27 @@ DCHECK(drm_thread_->IsRunning()); DCHECK(on_window_server_thread_.CalledOnValidThread()); auto callback = - base::Bind(&MusThreadProxy::GpuCheckOverlayCapabilitiesCallback, - weak_ptr_factory_.GetWeakPtr()); + base::BindOnce(&MusThreadProxy::GpuCheckOverlayCapabilitiesCallback, + weak_ptr_factory_.GetWeakPtr()); + auto safe_callback = CreateSafeOnceCallback(std::move(callback)); drm_thread_->task_runner()->PostTask( - FROM_HERE, base::Bind(&DrmThread::CheckOverlayCapabilities, - base::Unretained(drm_thread_), widget, overlays, - CreateSafeCallback(callback))); + FROM_HERE, base::BindOnce(&DrmThread::CheckOverlayCapabilities, + base::Unretained(drm_thread_), widget, overlays, + std::move(safe_callback))); return true; } bool MusThreadProxy::GpuRefreshNativeDisplays() { DCHECK(drm_thread_->IsRunning()); DCHECK(on_window_server_thread_.CalledOnValidThread()); - auto callback = base::Bind(&MusThreadProxy::GpuRefreshNativeDisplaysCallback, - weak_ptr_factory_.GetWeakPtr()); + auto callback = + base::BindOnce(&MusThreadProxy::GpuRefreshNativeDisplaysCallback, + weak_ptr_factory_.GetWeakPtr()); + auto safe_callback = CreateSafeOnceCallback(std::move(callback)); drm_thread_->task_runner()->PostTask( FROM_HERE, - base::Bind(&DrmThread::RefreshNativeDisplays, - base::Unretained(drm_thread_), CreateSafeCallback(callback))); + base::BindOnce(&DrmThread::RefreshNativeDisplays, + base::Unretained(drm_thread_), std::move(safe_callback))); return true; } @@ -213,36 +216,41 @@ DCHECK(drm_thread_->IsRunning()); DCHECK(on_window_server_thread_.CalledOnValidThread()); - auto callback = base::Bind(&MusThreadProxy::GpuConfigureNativeDisplayCallback, - weak_ptr_factory_.GetWeakPtr()); + auto callback = + base::BindOnce(&MusThreadProxy::GpuConfigureNativeDisplayCallback, + weak_ptr_factory_.GetWeakPtr()); + auto safe_callback = CreateSafeOnceCallback(std::move(callback)); drm_thread_->task_runner()->PostTask( - FROM_HERE, base::Bind(&DrmThread::ConfigureNativeDisplay, - base::Unretained(drm_thread_), id, mode, origin, - CreateSafeCallback(callback))); + FROM_HERE, base::BindOnce(&DrmThread::ConfigureNativeDisplay, + base::Unretained(drm_thread_), id, mode, origin, + std::move(safe_callback))); return true; } bool MusThreadProxy::GpuDisableNativeDisplay(int64_t id) { DCHECK(drm_thread_->IsRunning()); DCHECK(on_window_server_thread_.CalledOnValidThread()); - auto callback = base::Bind(&MusThreadProxy::GpuDisableNativeDisplayCallback, - weak_ptr_factory_.GetWeakPtr()); + auto callback = + base::BindOnce(&MusThreadProxy::GpuDisableNativeDisplayCallback, + weak_ptr_factory_.GetWeakPtr()); + auto safe_callback = CreateSafeOnceCallback(std::move(callback)); drm_thread_->task_runner()->PostTask( - FROM_HERE, base::Bind(&DrmThread::DisableNativeDisplay, - base::Unretained(drm_thread_), id, - CreateSafeCallback(callback))); + FROM_HERE, base::BindOnce(&DrmThread::DisableNativeDisplay, + base::Unretained(drm_thread_), id, + std::move(safe_callback))); return true; } bool MusThreadProxy::GpuTakeDisplayControl() { DCHECK(drm_thread_->IsRunning()); DCHECK(on_window_server_thread_.CalledOnValidThread()); - auto callback = base::Bind(&MusThreadProxy::GpuTakeDisplayControlCallback, - weak_ptr_factory_.GetWeakPtr()); + auto callback = base::BindOnce(&MusThreadProxy::GpuTakeDisplayControlCallback, + weak_ptr_factory_.GetWeakPtr()); + auto safe_callback = CreateSafeOnceCallback(std::move(callback)); drm_thread_->task_runner()->PostTask( FROM_HERE, - base::Bind(&DrmThread::TakeDisplayControl, base::Unretained(drm_thread_), - CreateSafeCallback(callback))); + base::BindOnce(&DrmThread::TakeDisplayControl, + base::Unretained(drm_thread_), std::move(safe_callback))); return true; } @@ -250,12 +258,13 @@ DCHECK(drm_thread_->IsRunning()); DCHECK(on_window_server_thread_.CalledOnValidThread()); auto callback = - base::Bind(&MusThreadProxy::GpuRelinquishDisplayControlCallback, - weak_ptr_factory_.GetWeakPtr()); + base::BindOnce(&MusThreadProxy::GpuRelinquishDisplayControlCallback, + weak_ptr_factory_.GetWeakPtr()); + auto safe_callback = CreateSafeOnceCallback(std::move(callback)); drm_thread_->task_runner()->PostTask( FROM_HERE, - base::Bind(&DrmThread::RelinquishDisplayControl, - base::Unretained(drm_thread_), CreateSafeCallback(callback))); + base::BindOnce(&DrmThread::RelinquishDisplayControl, + base::Unretained(drm_thread_), std::move(safe_callback))); return true; } @@ -281,12 +290,13 @@ bool MusThreadProxy::GpuGetHDCPState(int64_t display_id) { DCHECK(drm_thread_->IsRunning()); DCHECK(on_window_server_thread_.CalledOnValidThread()); - auto callback = base::Bind(&MusThreadProxy::GpuGetHDCPStateCallback, - weak_ptr_factory_.GetWeakPtr()); + auto callback = base::BindOnce(&MusThreadProxy::GpuGetHDCPStateCallback, + weak_ptr_factory_.GetWeakPtr()); + auto safe_callback = CreateSafeOnceCallback(std::move(callback)); drm_thread_->task_runner()->PostTask( FROM_HERE, - base::Bind(&DrmThread::GetHDCPState, base::Unretained(drm_thread_), - display_id, CreateSafeCallback(callback))); + base::BindOnce(&DrmThread::GetHDCPState, base::Unretained(drm_thread_), + display_id, std::move(safe_callback))); return true; } @@ -294,12 +304,13 @@ display::HDCPState state) { DCHECK(on_window_server_thread_.CalledOnValidThread()); DCHECK(drm_thread_->IsRunning()); - auto callback = base::Bind(&MusThreadProxy::GpuSetHDCPStateCallback, - weak_ptr_factory_.GetWeakPtr()); + auto callback = base::BindOnce(&MusThreadProxy::GpuSetHDCPStateCallback, + weak_ptr_factory_.GetWeakPtr()); + auto safe_callback = CreateSafeOnceCallback(std::move(callback)); drm_thread_->task_runner()->PostTask( FROM_HERE, - base::Bind(&DrmThread::SetHDCPState, base::Unretained(drm_thread_), - display_id, state, CreateSafeCallback(callback))); + base::BindOnce(&DrmThread::SetHDCPState, base::Unretained(drm_thread_), + display_id, state, std::move(safe_callback))); return true; }