diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-07-14 17:41:05 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-08-04 12:37:36 +0000 |
commit | 399c965b6064c440ddcf4015f5f8e9d131c7a0a6 (patch) | |
tree | 6b06b60ff365abef0e13b3503d593a0df48d20e8 /chromium/components/update_client | |
parent | 7366110654eec46f21b6824f302356426f48cd74 (diff) | |
download | qtwebengine-chromium-399c965b6064c440ddcf4015f5f8e9d131c7a0a6.tar.gz |
BASELINE: Update Chromium to 52.0.2743.76 and Ninja to 1.7.1
Change-Id: I382f51b959689505a60f8b707255ecb344f7d8b4
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/components/update_client')
43 files changed, 247 insertions, 201 deletions
diff --git a/chromium/components/update_client/BUILD.gn b/chromium/components/update_client/BUILD.gn index a6a89311607..7783b09877a 100644 --- a/chromium/components/update_client/BUILD.gn +++ b/chromium/components/update_client/BUILD.gn @@ -90,6 +90,27 @@ source_set("test_support") { ] } +bundle_data("unit_tests_bundle_data") { + visibility = [ ":unit_tests" ] + testonly = true + sources = [ + "//components/test/data/update_client/binary_bsdiff_patch.bin", + "//components/test/data/update_client/binary_courgette_patch.bin", + "//components/test/data/update_client/binary_input.bin", + "//components/test/data/update_client/binary_output.bin", + "//components/test/data/update_client/ihfokbkgjpifnbbojhneepfflplebdkc_1.crx", + "//components/test/data/update_client/ihfokbkgjpifnbbojhneepfflplebdkc_1to2.crx", + "//components/test/data/update_client/ihfokbkgjpifnbbojhneepfflplebdkc_2.crx", + "//components/test/data/update_client/jebgalgnebhfojomionfpkfelancnnkf.crx", + "//components/test/data/update_client/updatecheck_reply_1.xml", + "//components/test/data/update_client/updatecheck_reply_4.xml", + ] + outputs = [ + "{{bundle_resources_dir}}/" + + "{{source_root_relative_dir}}/{{source_file_part}}", + ] +} + source_set("unit_tests") { testonly = true sources = [ @@ -107,6 +128,7 @@ source_set("unit_tests") { deps = [ ":test_support", + ":unit_tests_bundle_data", ":update_client", "//base", "//components/prefs", diff --git a/chromium/components/update_client/action.cc b/chromium/components/update_client/action.cc index de795e68e2d..c550b2f1c60 100644 --- a/chromium/components/update_client/action.cc +++ b/chromium/components/update_client/action.cc @@ -11,7 +11,7 @@ #include "base/location.h" #include "base/memory/ref_counted.h" #include "base/single_thread_task_runner.h" -#include "base/thread_task_runner_handle.h" +#include "base/threading/thread_task_runner_handle.h" #include "components/update_client/action_update.h" #include "components/update_client/action_wait.h" #include "components/update_client/configurator.h" @@ -123,7 +123,7 @@ void ActionImpl::UpdateCrx() { CrxUpdateItem* item = FindUpdateItemById(id); DCHECK(item); - scoped_ptr<Action> update_action( + std::unique_ptr<Action> update_action( CanTryDiffUpdate(item, update_context_->config) ? ActionUpdateDiff::Create() : ActionUpdateFull::Create()); @@ -147,7 +147,7 @@ void ActionImpl::UpdateCrxComplete(CrxUpdateItem* item) { // to be injected at the call site of update_client::UpdateClient::Update. const int wait_sec = update_context_->config->UpdateDelay(); - scoped_ptr<ActionWait> action_wait( + std::unique_ptr<ActionWait> action_wait( new ActionWait(base::TimeDelta::FromSeconds(wait_sec))); base::ThreadTaskRunnerHandle::Get()->PostTask( diff --git a/chromium/components/update_client/action_update.cc b/chromium/components/update_client/action_update.cc index c8045a2fa58..2e33c1e54a6 100644 --- a/chromium/components/update_client/action_update.cc +++ b/chromium/components/update_client/action_update.cc @@ -11,7 +11,7 @@ #include "base/callback.h" #include "base/location.h" #include "base/logging.h" -#include "base/thread_task_runner_handle.h" +#include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" #include "base/version.h" #include "components/update_client/configurator.h" @@ -185,13 +185,13 @@ ActionUpdateDiff::~ActionUpdateDiff() { DCHECK(thread_checker_.CalledOnValidThread()); } -scoped_ptr<Action> ActionUpdateDiff::Create() { - return scoped_ptr<Action>(new ActionUpdateDiff); +std::unique_ptr<Action> ActionUpdateDiff::Create() { + return std::unique_ptr<Action>(new ActionUpdateDiff); } void ActionUpdateDiff::TryUpdateFull() { DCHECK(thread_checker_.CalledOnValidThread()); - scoped_ptr<Action> update_action(ActionUpdateFull::Create()); + std::unique_ptr<Action> update_action(ActionUpdateFull::Create()); base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(&Action::Run, base::Unretained(update_action.get()), @@ -286,8 +286,8 @@ ActionUpdateFull::~ActionUpdateFull() { DCHECK(thread_checker_.CalledOnValidThread()); } -scoped_ptr<Action> ActionUpdateFull::Create() { - return scoped_ptr<Action>(new ActionUpdateFull); +std::unique_ptr<Action> ActionUpdateFull::Create() { + return std::unique_ptr<Action>(new ActionUpdateFull); } bool ActionUpdateFull::IsBackgroundDownload(const CrxUpdateItem* item) { diff --git a/chromium/components/update_client/action_update.h b/chromium/components/update_client/action_update.h index b65ca645024..d9e789a4d7f 100644 --- a/chromium/components/update_client/action_update.h +++ b/chromium/components/update_client/action_update.h @@ -6,11 +6,11 @@ #define COMPONENTS_UPDATE_CLIENT_ACTION_UPDATE_H_ #include <map> +#include <memory> #include <string> #include <vector> #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/threading/thread_checker.h" #include "base/version.h" #include "components/update_client/action.h" @@ -85,7 +85,7 @@ class ActionUpdate : public Action, protected ActionImpl { int extended_error); // Downloads updates for one CRX id only. - scoped_ptr<CrxDownloader> crx_downloader_; + std::unique_ptr<CrxDownloader> crx_downloader_; // Unpacks one CRX. scoped_refptr<ComponentUnpacker> unpacker_; @@ -95,7 +95,7 @@ class ActionUpdate : public Action, protected ActionImpl { class ActionUpdateDiff : public ActionUpdate { public: - static scoped_ptr<Action> Create(); + static std::unique_ptr<Action> Create(); private: ActionUpdateDiff(); @@ -123,7 +123,7 @@ class ActionUpdateDiff : public ActionUpdate { class ActionUpdateFull : public ActionUpdate { public: - static scoped_ptr<Action> Create(); + static std::unique_ptr<Action> Create(); private: ActionUpdateFull(); diff --git a/chromium/components/update_client/action_update_check.cc b/chromium/components/update_client/action_update_check.cc index 13455f5ae7f..c6a0b25c38e 100644 --- a/chromium/components/update_client/action_update_check.cc +++ b/chromium/components/update_client/action_update_check.cc @@ -13,7 +13,7 @@ #include "base/location.h" #include "base/logging.h" #include "base/single_thread_task_runner.h" -#include "base/thread_task_runner_handle.h" +#include "base/threading/thread_task_runner_handle.h" #include "base/version.h" #include "components/update_client/action_update.h" #include "components/update_client/configurator.h" @@ -37,7 +37,7 @@ bool IsVersionNewer(const Version& current, const std::string& proposed) { } // namespace ActionUpdateCheck::ActionUpdateCheck( - scoped_ptr<UpdateChecker> update_checker, + std::unique_ptr<UpdateChecker> update_checker, const base::Version& browser_version, const std::string& extra_request_parameters) : update_checker_(std::move(update_checker)), @@ -61,7 +61,7 @@ void ActionUpdateCheck::Run(UpdateContext* update_context, Callback callback) { update_context_->update_items.reserve(crx_components.size()); for (size_t i = 0; i != crx_components.size(); ++i) { - scoped_ptr<CrxUpdateItem> item(new CrxUpdateItem); + std::unique_ptr<CrxUpdateItem> item(new CrxUpdateItem); const CrxComponent& crx_component = crx_components[i]; item->id = GetCrxComponentID(crx_component); diff --git a/chromium/components/update_client/action_update_check.h b/chromium/components/update_client/action_update_check.h index 67fc4d12a05..726f076ba8a 100644 --- a/chromium/components/update_client/action_update_check.h +++ b/chromium/components/update_client/action_update_check.h @@ -6,11 +6,11 @@ #define COMPONENTS_UPDATE_CLIENT_ACTION_UPDATE_CHECK_H_ #include <map> +#include <memory> #include <string> #include <vector> #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/threading/thread_checker.h" #include "base/version.h" #include "components/update_client/action.h" @@ -27,7 +27,7 @@ class UpdateChecker; // Implements an update check for the CRXs in an update context. class ActionUpdateCheck : public Action, private ActionImpl { public: - ActionUpdateCheck(scoped_ptr<UpdateChecker> update_checker, + ActionUpdateCheck(std::unique_ptr<UpdateChecker> update_checker, const base::Version& browser_version, const std::string& extra_request_parameters); @@ -43,7 +43,7 @@ class ActionUpdateCheck : public Action, private ActionImpl { void OnUpdateCheckSucceeded(const UpdateResponse::Results& results); void OnUpdateCheckFailed(int error); - scoped_ptr<UpdateChecker> update_checker_; + std::unique_ptr<UpdateChecker> update_checker_; const base::Version browser_version_; const std::string extra_request_parameters_; diff --git a/chromium/components/update_client/action_wait.cc b/chromium/components/update_client/action_wait.cc index 1e8f8059c5c..f18d7ccdbb3 100644 --- a/chromium/components/update_client/action_wait.cc +++ b/chromium/components/update_client/action_wait.cc @@ -8,7 +8,7 @@ #include "base/bind_helpers.h" #include "base/location.h" #include "base/single_thread_task_runner.h" -#include "base/thread_task_runner_handle.h" +#include "base/threading/thread_task_runner_handle.h" #include "components/update_client/update_engine.h" namespace update_client { diff --git a/chromium/components/update_client/background_downloader_win.cc b/chromium/components/update_client/background_downloader_win.cc index ea0b0ab440d..20d75c3e57a 100644 --- a/chromium/components/update_client/background_downloader_win.cc +++ b/chromium/components/update_client/background_downloader_win.cc @@ -418,7 +418,7 @@ HRESULT CleanupStaleJobs( } // namespace BackgroundDownloader::BackgroundDownloader( - scoped_ptr<CrxDownloader> successor, + std::unique_ptr<CrxDownloader> successor, net::URLRequestContextGetter* context_getter, const scoped_refptr<base::SequencedTaskRunner>& task_runner) : CrxDownloader(task_runner, std::move(successor)), diff --git a/chromium/components/update_client/background_downloader_win.h b/chromium/components/update_client/background_downloader_win.h index f0d5ecd6252..243461e644e 100644 --- a/chromium/components/update_client/background_downloader_win.h +++ b/chromium/components/update_client/background_downloader_win.h @@ -39,7 +39,7 @@ class BackgroundDownloader : public CrxDownloader { protected: friend class CrxDownloader; BackgroundDownloader( - scoped_ptr<CrxDownloader> successor, + std::unique_ptr<CrxDownloader> successor, net::URLRequestContextGetter* context_getter, const scoped_refptr<base::SequencedTaskRunner>& task_runner); ~BackgroundDownloader() override; @@ -122,7 +122,7 @@ class BackgroundDownloader : public CrxDownloader { // The timer has thread affinity. This member is initialized and destroyed // on the main task runner. - scoped_ptr<base::OneShotTimer> timer_; + std::unique_ptr<base::OneShotTimer> timer_; DWORD git_cookie_bits_manager_; DWORD git_cookie_job_; diff --git a/chromium/components/update_client/component_patcher.cc b/chromium/components/update_client/component_patcher.cc index 9105fda0849..7ceedce98cd 100644 --- a/chromium/components/update_client/component_patcher.cc +++ b/chromium/components/update_client/component_patcher.cc @@ -31,7 +31,7 @@ base::ListValue* ReadCommands(const base::FilePath& unpack_path) { return NULL; JSONFileValueDeserializer deserializer(commands); - scoped_ptr<base::Value> root = deserializer.Deserialize(NULL, NULL); + std::unique_ptr<base::Value> root = deserializer.Deserialize(NULL, NULL); return (root.get() && root->IsType(base::Value::TYPE_LIST)) ? static_cast<base::ListValue*>(root.release()) diff --git a/chromium/components/update_client/component_patcher.h b/chromium/components/update_client/component_patcher.h index 23c16c8fae1..0d11ad2ca37 100644 --- a/chromium/components/update_client/component_patcher.h +++ b/chromium/components/update_client/component_patcher.h @@ -27,10 +27,11 @@ #ifndef COMPONENTS_UPDATE_CLIENT_COMPONENT_PATCHER_H_ #define COMPONENTS_UPDATE_CLIENT_COMPONENT_PATCHER_H_ +#include <memory> + #include "base/callback_forward.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/values.h" #include "components/update_client/component_unpacker.h" @@ -89,7 +90,7 @@ class ComponentPatcher : public base::RefCountedThreadSafe<ComponentPatcher> { scoped_refptr<CrxInstaller> installer_; scoped_refptr<OutOfProcessPatcher> out_of_process_patcher_; ComponentUnpacker::Callback callback_; - scoped_ptr<base::ListValue> commands_; + std::unique_ptr<base::ListValue> commands_; base::ValueVector::const_iterator next_command_; scoped_refptr<DeltaUpdateOp> current_operation_; scoped_refptr<base::SequencedTaskRunner> task_runner_; diff --git a/chromium/components/update_client/component_patcher_operation.cc b/chromium/components/update_client/component_patcher_operation.cc index 2d2528ba616..2da622daacb 100644 --- a/chromium/components/update_client/component_patcher_operation.cc +++ b/chromium/components/update_client/component_patcher_operation.cc @@ -16,7 +16,7 @@ #include "components/update_client/update_client.h" #include "components/update_client/utils.h" #include "courgette/courgette.h" -#include "courgette/third_party/bsdiff.h" +#include "courgette/third_party/bsdiff/bsdiff.h" namespace update_client { diff --git a/chromium/components/update_client/component_patcher_unittest.cc b/chromium/components/update_client/component_patcher_unittest.cc index d7ce117ff26..ba8fafafafb 100644 --- a/chromium/components/update_client/component_patcher_unittest.cc +++ b/chromium/components/update_client/component_patcher_unittest.cc @@ -17,7 +17,7 @@ #include "components/update_client/component_patcher_unittest.h" #include "components/update_client/test_installer.h" #include "courgette/courgette.h" -#include "courgette/third_party/bsdiff.h" +#include "courgette/third_party/bsdiff/bsdiff.h" #include "testing/gtest/include/gtest/gtest.h" namespace { @@ -81,7 +81,8 @@ TEST_F(ComponentPatcherOperationTest, CheckCreateOperation) { test_file("binary_output.bin"), input_dir_.path().Append(FILE_PATH_LITERAL("binary_output.bin")))); - scoped_ptr<base::DictionaryValue> command_args(new base::DictionaryValue()); + std::unique_ptr<base::DictionaryValue> command_args( + new base::DictionaryValue()); command_args->SetString("output", "output.bin"); command_args->SetString("sha256", binary_output_hash); command_args->SetString("op", "create"); @@ -108,7 +109,8 @@ TEST_F(ComponentPatcherOperationTest, CheckCopyOperation) { test_file("binary_output.bin"), installed_dir_.path().Append(FILE_PATH_LITERAL("binary_output.bin")))); - scoped_ptr<base::DictionaryValue> command_args(new base::DictionaryValue()); + std::unique_ptr<base::DictionaryValue> command_args( + new base::DictionaryValue()); command_args->SetString("output", "output.bin"); command_args->SetString("sha256", binary_output_hash); command_args->SetString("op", "copy"); @@ -139,7 +141,8 @@ TEST_F(ComponentPatcherOperationTest, CheckCourgetteOperation) { input_dir_.path().Append(FILE_PATH_LITERAL( "binary_courgette_patch.bin")))); - scoped_ptr<base::DictionaryValue> command_args(new base::DictionaryValue()); + std::unique_ptr<base::DictionaryValue> command_args( + new base::DictionaryValue()); command_args->SetString("output", "output.bin"); command_args->SetString("sha256", binary_output_hash); command_args->SetString("op", "courgette"); @@ -172,7 +175,8 @@ TEST_F(ComponentPatcherOperationTest, CheckBsdiffOperation) { test_file("binary_bsdiff_patch.bin"), input_dir_.path().Append(FILE_PATH_LITERAL("binary_bsdiff_patch.bin")))); - scoped_ptr<base::DictionaryValue> command_args(new base::DictionaryValue()); + std::unique_ptr<base::DictionaryValue> command_args( + new base::DictionaryValue()); command_args->SetString("output", "output.bin"); command_args->SetString("sha256", binary_output_hash); command_args->SetString("op", "courgette"); diff --git a/chromium/components/update_client/component_patcher_unittest.h b/chromium/components/update_client/component_patcher_unittest.h index 8b3a7975d6b..f21d104e8f2 100644 --- a/chromium/components/update_client/component_patcher_unittest.h +++ b/chromium/components/update_client/component_patcher_unittest.h @@ -5,12 +5,13 @@ #ifndef COMPONENTS_UPDATE_CLIENT_COMPONENT_PATCHER_UNITTEST_H_ #define COMPONENTS_UPDATE_CLIENT_COMPONENT_PATCHER_UNITTEST_H_ +#include <memory> + #include "base/files/file_path.h" #include "base/files/scoped_temp_dir.h" -#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "courgette/courgette.h" -#include "courgette/third_party/bsdiff.h" +#include "courgette/third_party/bsdiff/bsdiff.h" #include "testing/gtest/include/gtest/gtest.h" namespace update_client { diff --git a/chromium/components/update_client/component_unpacker.cc b/chromium/components/update_client/component_unpacker.cc index 91c9b77e92d..dc21319703f 100644 --- a/chromium/components/update_client/component_unpacker.cc +++ b/chromium/components/update_client/component_unpacker.cc @@ -55,20 +55,20 @@ ComponentUnpacker::ComponentUnpacker( // TODO(cpu): add a specific attribute check to a component json that the // extension unpacker will reject, so that a component cannot be installed // as an extension. -scoped_ptr<base::DictionaryValue> ReadManifest( +std::unique_ptr<base::DictionaryValue> ReadManifest( const base::FilePath& unpack_path) { base::FilePath manifest = unpack_path.Append(FILE_PATH_LITERAL("manifest.json")); if (!base::PathExists(manifest)) - return scoped_ptr<base::DictionaryValue>(); + return std::unique_ptr<base::DictionaryValue>(); JSONFileValueDeserializer deserializer(manifest); std::string error; - scoped_ptr<base::Value> root = deserializer.Deserialize(NULL, &error); + std::unique_ptr<base::Value> root = deserializer.Deserialize(NULL, &error); if (!root.get()) - return scoped_ptr<base::DictionaryValue>(); + return std::unique_ptr<base::DictionaryValue>(); if (!root->IsType(base::Value::TYPE_DICTIONARY)) - return scoped_ptr<base::DictionaryValue>(); - return scoped_ptr<base::DictionaryValue>( + return std::unique_ptr<base::DictionaryValue>(); + return std::unique_ptr<base::DictionaryValue>( static_cast<base::DictionaryValue*>(root.release())); } @@ -106,7 +106,7 @@ bool ComponentUnpacker::Verify() { // the public key hash matches the expected hash. If they do we fully // trust this CRX. uint8_t hash[crypto::kSHA256Length] = {}; - scoped_ptr<SecureHash> sha256(SecureHash::Create(SecureHash::SHA256)); + std::unique_ptr<SecureHash> sha256(SecureHash::Create(SecureHash::SHA256)); sha256->Update(public_key_bytes.data(), public_key_bytes.size()); sha256->Finish(hash, arraysize(hash)); @@ -188,7 +188,7 @@ void ComponentUnpacker::Install() { error_ = kFingerprintWriteFailed; return; } - scoped_ptr<base::DictionaryValue> manifest(ReadManifest(unpack_path_)); + std::unique_ptr<base::DictionaryValue> manifest(ReadManifest(unpack_path_)); if (!manifest.get()) { error_ = kBadManifest; return; diff --git a/chromium/components/update_client/component_unpacker.h b/chromium/components/update_client/component_unpacker.h index c1c6c9e39dc..66a44d3e757 100644 --- a/chromium/components/update_client/component_unpacker.h +++ b/chromium/components/update_client/component_unpacker.h @@ -6,6 +6,8 @@ #define COMPONENTS_UPDATE_CLIENT_COMPONENT_UNPACKER_H_ #include <stdint.h> + +#include <memory> #include <string> #include <vector> @@ -14,7 +16,6 @@ #include "base/json/json_file_value_serializer.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/sequenced_task_runner.h" namespace update_client { @@ -24,7 +25,7 @@ class ComponentPatcher; class OutOfProcessPatcher; // Deserializes the CRX manifest. The top level must be a dictionary. -scoped_ptr<base::DictionaryValue> ReadManifest( +std::unique_ptr<base::DictionaryValue> ReadManifest( const base::FilePath& unpack_path); // In charge of unpacking the component CRX package and verifying that it is diff --git a/chromium/components/update_client/configurator.h b/chromium/components/update_client/configurator.h index 63745c038e8..7f55b9b761e 100644 --- a/chromium/components/update_client/configurator.h +++ b/chromium/components/update_client/configurator.h @@ -5,11 +5,11 @@ #ifndef COMPONENTS_UPDATE_CLIENT_CONFIGURATOR_H_ #define COMPONENTS_UPDATE_CLIENT_CONFIGURATOR_H_ +#include <memory> #include <string> #include <vector> #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" class GURL; class PrefService; diff --git a/chromium/components/update_client/crx_downloader.cc b/chromium/components/update_client/crx_downloader.cc index 352a539ce0c..6a6cd4e3caf 100644 --- a/chromium/components/update_client/crx_downloader.cc +++ b/chromium/components/update_client/crx_downloader.cc @@ -12,7 +12,7 @@ #include "base/location.h" #include "base/logging.h" #include "base/sequenced_task_runner.h" -#include "base/thread_task_runner_handle.h" +#include "base/threading/thread_task_runner_handle.h" #include "build/build_config.h" #if defined(OS_WIN) #include "components/update_client/background_downloader_win.h" @@ -36,16 +36,16 @@ CrxDownloader::DownloadMetrics::DownloadMetrics() // On Windows, the first downloader in the chain is a background downloader, // which uses the BITS service. -scoped_ptr<CrxDownloader> CrxDownloader::Create( +std::unique_ptr<CrxDownloader> CrxDownloader::Create( bool is_background_download, net::URLRequestContextGetter* context_getter, const scoped_refptr<base::SequencedTaskRunner>& task_runner) { - scoped_ptr<CrxDownloader> url_fetcher_downloader( - scoped_ptr<CrxDownloader>(new UrlFetcherDownloader( - scoped_ptr<CrxDownloader>(), context_getter, task_runner))); + std::unique_ptr<CrxDownloader> url_fetcher_downloader( + std::unique_ptr<CrxDownloader>(new UrlFetcherDownloader( + std::unique_ptr<CrxDownloader>(), context_getter, task_runner))); #if defined(OS_WIN) if (is_background_download) { - return scoped_ptr<CrxDownloader>(new BackgroundDownloader( + return std::unique_ptr<CrxDownloader>(new BackgroundDownloader( std::move(url_fetcher_downloader), context_getter, task_runner)); } #endif @@ -55,7 +55,7 @@ scoped_ptr<CrxDownloader> CrxDownloader::Create( CrxDownloader::CrxDownloader( const scoped_refptr<base::SequencedTaskRunner>& task_runner, - scoped_ptr<CrxDownloader> successor) + std::unique_ptr<CrxDownloader> successor) : task_runner_(task_runner), main_task_runner_(base::ThreadTaskRunnerHandle::Get()), successor_(std::move(successor)) {} diff --git a/chromium/components/update_client/crx_downloader.h b/chromium/components/update_client/crx_downloader.h index f7caa8bff67..5d5537dcbdf 100644 --- a/chromium/components/update_client/crx_downloader.h +++ b/chromium/components/update_client/crx_downloader.h @@ -6,6 +6,8 @@ #define COMPONENTS_UPDATE_CLIENT_CRX_DOWNLOADER_H_ #include <stdint.h> + +#include <memory> #include <string> #include <vector> @@ -13,7 +15,6 @@ #include "base/files/file_path.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/sequenced_task_runner.h" #include "base/threading/thread_checker.h" #include "url/gurl.h" @@ -96,7 +97,7 @@ class CrxDownloader { // bytes is not guaranteed to monotonically increment over time. using ProgressCallback = base::Callback<void(const Result& result)>; - using Factory = scoped_ptr<CrxDownloader> (*)( + using Factory = std::unique_ptr<CrxDownloader> (*)( bool, net::URLRequestContextGetter*, const scoped_refptr<base::SequencedTaskRunner>&); @@ -106,7 +107,7 @@ class CrxDownloader { // background downloader be used, if the platform supports it. // |task_runner| should be a task runner able to run blocking // code such as file IO operations. - static scoped_ptr<CrxDownloader> Create( + static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter, const scoped_refptr<base::SequencedTaskRunner>& task_runner); @@ -130,7 +131,7 @@ class CrxDownloader { protected: CrxDownloader(const scoped_refptr<base::SequencedTaskRunner>& task_runner, - scoped_ptr<CrxDownloader> successor); + std::unique_ptr<CrxDownloader> successor); // Handles the fallback in the case of multiple urls and routing of the // download to the following successor in the chain. Derived classes must call @@ -181,7 +182,7 @@ class CrxDownloader { // The SHA256 hash of the download payload in hexadecimal format. std::string expected_hash_; - scoped_ptr<CrxDownloader> successor_; + std::unique_ptr<CrxDownloader> successor_; DownloadCallback download_callback_; ProgressCallback progress_callback_; diff --git a/chromium/components/update_client/crx_downloader_unittest.cc b/chromium/components/update_client/crx_downloader_unittest.cc index 7b1a1848ba5..cdc209c7717 100644 --- a/chromium/components/update_client/crx_downloader_unittest.cc +++ b/chromium/components/update_client/crx_downloader_unittest.cc @@ -2,17 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "components/update_client/crx_downloader.h" + +#include <memory> + #include "base/bind.h" #include "base/bind_helpers.h" #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/path_service.h" #include "base/run_loop.h" -#include "base/thread_task_runner_handle.h" +#include "base/threading/thread_task_runner_handle.h" #include "build/build_config.h" -#include "components/update_client/crx_downloader.h" #include "net/base/net_errors.h" #include "net/url_request/test_url_request_interceptor.h" #include "net/url_request/url_request_test_util.h" @@ -59,9 +61,9 @@ class CrxDownloaderTest : public testing::Test { void DownloadProgress(int crx_context, const CrxDownloader::Result& result); protected: - scoped_ptr<CrxDownloader> crx_downloader_; + std::unique_ptr<CrxDownloader> crx_downloader_; - scoped_ptr<GetInterceptor> get_interceptor_; + std::unique_ptr<GetInterceptor> get_interceptor_; CrxDownloader::DownloadCallback callback_; CrxDownloader::ProgressCallback progress_callback_; diff --git a/chromium/components/update_client/ping_manager.cc b/chromium/components/update_client/ping_manager.cc index 2d665933db0..59ee87523e3 100644 --- a/chromium/components/update_client/ping_manager.cc +++ b/chromium/components/update_client/ping_manager.cc @@ -6,6 +6,7 @@ #include <stddef.h> +#include <memory> #include <string> #include <vector> @@ -15,7 +16,6 @@ #include "base/location.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/sequenced_task_runner.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" @@ -184,7 +184,7 @@ class PingSender { int retry_after_sec); const scoped_refptr<Configurator> config_; - scoped_ptr<RequestSender> request_sender_; + std::unique_ptr<RequestSender> request_sender_; base::ThreadChecker thread_checker_; DISALLOW_COPY_AND_ASSIGN(PingSender); @@ -231,7 +231,7 @@ PingManager::~PingManager() { } bool PingManager::SendPing(const CrxUpdateItem* item) { - scoped_ptr<PingSender> ping_sender(new PingSender(config_)); + std::unique_ptr<PingSender> ping_sender(new PingSender(config_)); if (!ping_sender->SendPing(item)) return false; diff --git a/chromium/components/update_client/ping_manager_unittest.cc b/chromium/components/update_client/ping_manager_unittest.cc index e25dc94533a..ba7464c8bf0 100644 --- a/chromium/components/update_client/ping_manager_unittest.cc +++ b/chromium/components/update_client/ping_manager_unittest.cc @@ -2,15 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "components/update_client/ping_manager.h" + +#include <memory> #include <string> #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/run_loop.h" -#include "base/thread_task_runner_handle.h" +#include "base/threading/thread_task_runner_handle.h" #include "base/version.h" #include "components/update_client/crx_update_item.h" -#include "components/update_client/ping_manager.h" #include "components/update_client/test_configurator.h" #include "components/update_client/url_request_post_interceptor.h" #include "net/url_request/url_request_test_util.h" @@ -33,7 +34,7 @@ class ComponentUpdaterPingManagerTest : public testing::Test { protected: scoped_refptr<TestConfigurator> config_; - scoped_ptr<PingManager> ping_manager_; + std::unique_ptr<PingManager> ping_manager_; private: base::MessageLoopForIO loop_; @@ -59,7 +60,7 @@ void ComponentUpdaterPingManagerTest::RunThreadsUntilIdle() { // Test is flaky: http://crbug.com/349547 TEST_F(ComponentUpdaterPingManagerTest, DISABLED_PingManagerTest) { - scoped_ptr<InterceptorFactory> interceptor_factory( + std::unique_ptr<InterceptorFactory> interceptor_factory( new InterceptorFactory(base::ThreadTaskRunnerHandle::Get())); URLRequestPostInterceptor* interceptor = interceptor_factory->CreateInterceptor(); diff --git a/chromium/components/update_client/request_sender.cc b/chromium/components/update_client/request_sender.cc index fc875d3a48a..7f48dd72351 100644 --- a/chromium/components/update_client/request_sender.cc +++ b/chromium/components/update_client/request_sender.cc @@ -13,7 +13,7 @@ #include "base/logging.h" #include "base/single_thread_task_runner.h" #include "base/strings/stringprintf.h" -#include "base/thread_task_runner_handle.h" +#include "base/threading/thread_task_runner_handle.h" #include "components/client_update_protocol/ecdsa.h" #include "components/update_client/configurator.h" #include "components/update_client/utils.h" diff --git a/chromium/components/update_client/request_sender.h b/chromium/components/update_client/request_sender.h index b5daaa2e518..f1ec16e95d4 100644 --- a/chromium/components/update_client/request_sender.h +++ b/chromium/components/update_client/request_sender.h @@ -7,13 +7,13 @@ #include <stdint.h> +#include <memory> #include <string> #include <vector> #include "base/callback.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/threading/thread_checker.h" #include "net/url_request/url_fetcher_delegate.h" #include "url/gurl.h" @@ -100,8 +100,8 @@ class RequestSender : public net::URLFetcherDelegate { std::string public_key_; std::vector<GURL>::const_iterator cur_url_; - scoped_ptr<net::URLFetcher> url_fetcher_; - scoped_ptr<client_update_protocol::Ecdsa> signer_; + std::unique_ptr<net::URLFetcher> url_fetcher_; + std::unique_ptr<client_update_protocol::Ecdsa> signer_; DISALLOW_COPY_AND_ASSIGN(RequestSender); }; diff --git a/chromium/components/update_client/request_sender_unittest.cc b/chromium/components/update_client/request_sender_unittest.cc index 55821324cbc..3b1c635c41b 100644 --- a/chromium/components/update_client/request_sender_unittest.cc +++ b/chromium/components/update_client/request_sender_unittest.cc @@ -2,13 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "components/update_client/request_sender.h" + +#include <memory> + #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/run_loop.h" #include "base/strings/string_util.h" -#include "base/thread_task_runner_handle.h" -#include "components/update_client/request_sender.h" +#include "base/threading/thread_task_runner_handle.h" #include "components/update_client/test_configurator.h" #include "components/update_client/url_request_post_interceptor.h" #include "net/url_request/url_fetcher.h" @@ -55,8 +57,8 @@ class RequestSenderTest : public testing::Test { void RunThreadsUntilIdle(); scoped_refptr<TestConfigurator> config_; - scoped_ptr<RequestSender> request_sender_; - scoped_ptr<InterceptorFactory> interceptor_factory_; + std::unique_ptr<RequestSender> request_sender_; + std::unique_ptr<InterceptorFactory> interceptor_factory_; URLRequestPostInterceptor* post_interceptor_1_; // Owned by the factory. URLRequestPostInterceptor* post_interceptor_2_; // Owned by the factory. diff --git a/chromium/components/update_client/task.h b/chromium/components/update_client/task.h index 0a5b7f32f92..929ae7e8e6f 100644 --- a/chromium/components/update_client/task.h +++ b/chromium/components/update_client/task.h @@ -5,11 +5,11 @@ #ifndef COMPONENTS_UPDATE_CLIENT_TASK_H_ #define COMPONENTS_UPDATE_CLIENT_TASK_H_ +#include <memory> #include <string> #include <vector> #include "base/callback.h" -#include "base/memory/scoped_ptr.h" #include "components/update_client/update_client.h" namespace update_client { diff --git a/chromium/components/update_client/task_update.cc b/chromium/components/update_client/task_update.cc index c6a72e6ee2f..da423667bc4 100644 --- a/chromium/components/update_client/task_update.cc +++ b/chromium/components/update_client/task_update.cc @@ -7,7 +7,7 @@ #include "base/bind_helpers.h" #include "base/location.h" #include "base/single_thread_task_runner.h" -#include "base/thread_task_runner_handle.h" +#include "base/threading/thread_task_runner_handle.h" #include "components/update_client/update_client.h" #include "components/update_client/update_engine.h" diff --git a/chromium/components/update_client/update_checker.cc b/chromium/components/update_client/update_checker.cc index 7f40a0c952f..7ffcecc1f47 100644 --- a/chromium/components/update_client/update_checker.cc +++ b/chromium/components/update_client/update_checker.cc @@ -6,6 +6,7 @@ #include <stddef.h> +#include <memory> #include <string> #include <vector> @@ -14,10 +15,9 @@ #include "base/location.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/strings/stringprintf.h" -#include "base/thread_task_runner_handle.h" #include "base/threading/thread_checker.h" +#include "base/threading/thread_task_runner_handle.h" #include "components/update_client/configurator.h" #include "components/update_client/crx_update_item.h" #include "components/update_client/persisted_data.h" @@ -116,16 +116,17 @@ class UpdateCheckerImpl : public UpdateChecker { const UpdateCheckCallback& update_check_callback) override; private: - void OnRequestSenderComplete(scoped_ptr<std::vector<std::string>> ids_checked, - int error, - const std::string& response, - int retry_after_sec); + void OnRequestSenderComplete( + std::unique_ptr<std::vector<std::string>> ids_checked, + int error, + const std::string& response, + int retry_after_sec); base::ThreadChecker thread_checker_; const scoped_refptr<Configurator> config_; PersistedData* metadata_; UpdateCheckCallback update_check_callback_; - scoped_ptr<RequestSender> request_sender_; + std::unique_ptr<RequestSender> request_sender_; DISALLOW_COPY_AND_ASSIGN(UpdateCheckerImpl); }; @@ -199,10 +200,11 @@ void UpdateCheckerImpl::OnRequestSenderComplete( } // namespace -scoped_ptr<UpdateChecker> UpdateChecker::Create( +std::unique_ptr<UpdateChecker> UpdateChecker::Create( const scoped_refptr<Configurator>& config, PersistedData* persistent) { - return scoped_ptr<UpdateChecker>(new UpdateCheckerImpl(config, persistent)); + return std::unique_ptr<UpdateChecker>( + new UpdateCheckerImpl(config, persistent)); } } // namespace update_client diff --git a/chromium/components/update_client/update_checker.h b/chromium/components/update_client/update_checker.h index 2af7e7a0484..2705018ba95 100644 --- a/chromium/components/update_client/update_checker.h +++ b/chromium/components/update_client/update_checker.h @@ -5,13 +5,13 @@ #ifndef COMPONENTS_UPDATE_CLIENT_UPDATE_CHECKER_H_ #define COMPONENTS_UPDATE_CLIENT_UPDATE_CHECKER_H_ +#include <memory> #include <string> #include <vector> #include "base/callback.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "components/update_client/update_response.h" #include "url/gurl.h" @@ -30,9 +30,9 @@ class UpdateChecker { const UpdateResponse::Results& results, int retry_after_sec)>; - using Factory = - scoped_ptr<UpdateChecker> (*)(const scoped_refptr<Configurator>& config, - PersistedData* persistent); + using Factory = std::unique_ptr<UpdateChecker> (*)( + const scoped_refptr<Configurator>& config, + PersistedData* persistent); virtual ~UpdateChecker() {} @@ -44,7 +44,7 @@ class UpdateChecker { const std::string& additional_attributes, const UpdateCheckCallback& update_check_callback) = 0; - static scoped_ptr<UpdateChecker> Create( + static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* persistent); diff --git a/chromium/components/update_client/update_checker_unittest.cc b/chromium/components/update_client/update_checker_unittest.cc index 7fd0972efac..9e528dc4dd5 100644 --- a/chromium/components/update_client/update_checker_unittest.cc +++ b/chromium/components/update_client/update_checker_unittest.cc @@ -2,21 +2,23 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "components/update_client/update_checker.h" + +#include <memory> + #include "base/bind.h" #include "base/bind_helpers.h" #include "base/files/file_util.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/path_service.h" #include "base/run_loop.h" -#include "base/thread_task_runner_handle.h" +#include "base/threading/thread_task_runner_handle.h" #include "base/version.h" #include "components/prefs/testing_pref_service.h" #include "components/update_client/crx_update_item.h" #include "components/update_client/persisted_data.h" #include "components/update_client/test_configurator.h" -#include "components/update_client/update_checker.h" #include "components/update_client/url_request_post_interceptor.h" #include "net/url_request/url_request_test_util.h" #include "testing/gtest/include/gtest/gtest.h" @@ -64,9 +66,9 @@ class UpdateCheckerTest : public testing::Test { std::unique_ptr<TestingPrefServiceSimple> pref_; std::unique_ptr<PersistedData> metadata_; - scoped_ptr<UpdateChecker> update_checker_; + std::unique_ptr<UpdateChecker> update_checker_; - scoped_ptr<InterceptorFactory> interceptor_factory_; + std::unique_ptr<InterceptorFactory> interceptor_factory_; URLRequestPostInterceptor* post_interceptor_; // Owned by the factory. int error_; diff --git a/chromium/components/update_client/update_client.cc b/chromium/components/update_client/update_client.cc index 8e1fdf230cd..176d5b9d511 100644 --- a/chromium/components/update_client/update_client.cc +++ b/chromium/components/update_client/update_client.cc @@ -19,9 +19,9 @@ #include "base/observer_list.h" #include "base/sequenced_task_runner.h" #include "base/single_thread_task_runner.h" -#include "base/thread_task_runner_handle.h" #include "base/threading/sequenced_worker_pool.h" #include "base/threading/thread_checker.h" +#include "base/threading/thread_task_runner_handle.h" #include "components/prefs/pref_registry_simple.h" #include "components/update_client/configurator.h" #include "components/update_client/crx_update_item.h" @@ -70,7 +70,7 @@ CrxComponent::~CrxComponent() { // including any thread objects that might execute callbacks bound to it. UpdateClientImpl::UpdateClientImpl( const scoped_refptr<Configurator>& config, - scoped_ptr<PingManager> ping_manager, + std::unique_ptr<PingManager> ping_manager, UpdateChecker::Factory update_checker_factory, CrxDownloader::Factory crx_downloader_factory) : is_stopped_(false), @@ -110,8 +110,8 @@ void UpdateClientImpl::Install(const std::string& id, // argument is available when the task completes, along with the task itself. const auto callback = base::Bind(&UpdateClientImpl::OnTaskComplete, this, completion_callback); - scoped_ptr<TaskUpdate> task(new TaskUpdate(update_engine_.get(), true, ids, - crx_data_callback, callback)); + std::unique_ptr<TaskUpdate> task(new TaskUpdate( + update_engine_.get(), true, ids, crx_data_callback, callback)); // Install tasks are run concurrently and never queued up. RunTask(std::move(task)); @@ -124,8 +124,8 @@ void UpdateClientImpl::Update(const std::vector<std::string>& ids, const auto callback = base::Bind(&UpdateClientImpl::OnTaskComplete, this, completion_callback); - scoped_ptr<TaskUpdate> task(new TaskUpdate(update_engine_.get(), false, ids, - crx_data_callback, callback)); + std::unique_ptr<TaskUpdate> task(new TaskUpdate( + update_engine_.get(), false, ids, crx_data_callback, callback)); // If no other tasks are running at the moment, run this update task. // Otherwise, queue the task up. @@ -136,7 +136,7 @@ void UpdateClientImpl::Update(const std::vector<std::string>& ids, } } -void UpdateClientImpl::RunTask(scoped_ptr<Task> task) { +void UpdateClientImpl::RunTask(std::unique_ptr<Task> task) { DCHECK(thread_checker_.CalledOnValidThread()); base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(&Task::Run, base::Unretained(task.get()))); @@ -167,7 +167,7 @@ void UpdateClientImpl::OnTaskComplete( // Pick up a task from the queue if the queue has pending tasks and no other // task is running. if (tasks_.empty() && !task_queue_.empty()) { - RunTask(scoped_ptr<Task>(task_queue_.front())); + RunTask(std::unique_ptr<Task>(task_queue_.front())); task_queue_.pop(); } } @@ -250,7 +250,7 @@ void UpdateClientImpl::SendUninstallPing(const std::string& id, scoped_refptr<UpdateClient> UpdateClientFactory( const scoped_refptr<Configurator>& config) { - scoped_ptr<PingManager> ping_manager(new PingManager(config)); + std::unique_ptr<PingManager> ping_manager(new PingManager(config)); return new UpdateClientImpl(config, std::move(ping_manager), &UpdateChecker::Create, &CrxDownloader::Create); } diff --git a/chromium/components/update_client/update_client.h b/chromium/components/update_client/update_client.h index 16df41c9499..0c0e42d20c8 100644 --- a/chromium/components/update_client/update_client.h +++ b/chromium/components/update_client/update_client.h @@ -6,12 +6,13 @@ #define COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_H_ #include <stdint.h> + +#include <memory> #include <string> #include <vector> #include "base/callback_forward.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/version.h" // The UpdateClient class is a facade with a simple interface. The interface @@ -48,7 +49,7 @@ // of this code has already implemented the observer interface as needed, and // can provide an installer, as described below. // -// scoped_ptr<UpdateClient> update_client(UpdateClientFactory(...)); +// std::unique_ptr<UpdateClient> update_client(UpdateClientFactory(...)); // update_client->AddObserver(&observer); // std::vector<std::string> ids; // ids.push_back(...)); diff --git a/chromium/components/update_client/update_client_internal.h b/chromium/components/update_client/update_client_internal.h index 6df2b99dd02..47e9af611c6 100644 --- a/chromium/components/update_client/update_client_internal.h +++ b/chromium/components/update_client/update_client_internal.h @@ -5,8 +5,7 @@ #ifndef COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_INTERNAL_H_ #define COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_INTERNAL_H_ -#include "components/update_client/update_client.h" - +#include <memory> #include <queue> #include <set> #include <string> @@ -14,11 +13,11 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "base/threading/thread_checker.h" #include "components/update_client/crx_downloader.h" #include "components/update_client/update_checker.h" +#include "components/update_client/update_client.h" namespace base { class SequencedTaskRunner; @@ -36,7 +35,7 @@ class UpdateEngine; class UpdateClientImpl : public UpdateClient { public: UpdateClientImpl(const scoped_refptr<Configurator>& config, - scoped_ptr<PingManager> ping_manager, + std::unique_ptr<PingManager> ping_manager, UpdateChecker::Factory update_checker_factory, CrxDownloader::Factory crx_downloader_factory); @@ -60,7 +59,7 @@ class UpdateClientImpl : public UpdateClient { private: ~UpdateClientImpl() override; - void RunTask(scoped_ptr<Task> task); + void RunTask(std::unique_ptr<Task> task); void OnTaskComplete(const CompletionCallback& completion_callback, Task* task, int error); @@ -88,8 +87,8 @@ class UpdateClientImpl : public UpdateClient { std::set<Task*> tasks_; // TODO(sorin): try to make the ping manager an observer of the service. - scoped_ptr<PingManager> ping_manager_; - scoped_ptr<UpdateEngine> update_engine_; + std::unique_ptr<PingManager> ping_manager_; + std::unique_ptr<UpdateEngine> update_engine_; base::ObserverList<Observer> observer_list_; diff --git a/chromium/components/update_client/update_client_unittest.cc b/chromium/components/update_client/update_client_unittest.cc index 1bdfa2f1b9d..a869f9a3cf9 100644 --- a/chromium/components/update_client/update_client_unittest.cc +++ b/chromium/components/update_client/update_client_unittest.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> #include <utility> #include "base/bind.h" @@ -10,13 +11,13 @@ #include "base/files/file_util.h" #include "base/location.h" #include "base/macros.h" +#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/path_service.h" #include "base/run_loop.h" #include "base/test/sequenced_worker_pool_owner.h" -#include "base/thread_task_runner_handle.h" +#include "base/threading/thread_task_runner_handle.h" #include "base/values.h" #include "base/version.h" #include "components/prefs/testing_pref_service.h" @@ -159,7 +160,7 @@ class UpdateClientTest : public testing::Test { base::RunLoop runloop_; base::Closure quit_closure_; - scoped_ptr<base::SequencedWorkerPoolOwner> worker_pool_; + std::unique_ptr<base::SequencedWorkerPoolOwner> worker_pool_; scoped_refptr<update_client::Configurator> config_; std::unique_ptr<TestingPrefServiceSimple> pref_; @@ -225,10 +226,10 @@ TEST_F(UpdateClientTest, OneCrxNoUpdate) { class FakeUpdateChecker : public UpdateChecker { public: - static scoped_ptr<UpdateChecker> Create( + static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return scoped_ptr<UpdateChecker>(new FakeUpdateChecker()); + return std::unique_ptr<UpdateChecker>(new FakeUpdateChecker()); } bool CheckForUpdates( @@ -244,11 +245,11 @@ TEST_F(UpdateClientTest, OneCrxNoUpdate) { class FakeCrxDownloader : public CrxDownloader { public: - static scoped_ptr<CrxDownloader> Create( + static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter, const scoped_refptr<base::SequencedTaskRunner>& task_runner) { - return scoped_ptr<CrxDownloader>(new FakeCrxDownloader()); + return std::unique_ptr<CrxDownloader>(new FakeCrxDownloader()); } private: @@ -266,7 +267,7 @@ TEST_F(UpdateClientTest, OneCrxNoUpdate) { ~FakePingManager() override { EXPECT_TRUE(items().empty()); } }; - scoped_ptr<PingManager> ping_manager(new FakePingManager(config())); + std::unique_ptr<PingManager> ping_manager(new FakePingManager(config())); scoped_refptr<UpdateClient> update_client(new UpdateClientImpl( config(), std::move(ping_manager), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create)); @@ -332,10 +333,10 @@ TEST_F(UpdateClientTest, TwoCrxUpdateNoUpdate) { class FakeUpdateChecker : public UpdateChecker { public: - static scoped_ptr<UpdateChecker> Create( + static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return scoped_ptr<UpdateChecker>(new FakeUpdateChecker()); + return std::unique_ptr<UpdateChecker>(new FakeUpdateChecker()); } bool CheckForUpdates( @@ -386,11 +387,11 @@ TEST_F(UpdateClientTest, TwoCrxUpdateNoUpdate) { class FakeCrxDownloader : public CrxDownloader { public: - static scoped_ptr<CrxDownloader> Create( + static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter, const scoped_refptr<base::SequencedTaskRunner>& task_runner) { - return scoped_ptr<CrxDownloader>(new FakeCrxDownloader()); + return std::unique_ptr<CrxDownloader>(new FakeCrxDownloader()); } private: @@ -443,7 +444,7 @@ TEST_F(UpdateClientTest, TwoCrxUpdateNoUpdate) { } }; - scoped_ptr<PingManager> ping_manager(new FakePingManager(config())); + std::unique_ptr<PingManager> ping_manager(new FakePingManager(config())); scoped_refptr<UpdateClient> update_client(new UpdateClientImpl( config(), std::move(ping_manager), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create)); @@ -518,10 +519,10 @@ TEST_F(UpdateClientTest, TwoCrxUpdate) { class FakeUpdateChecker : public UpdateChecker { public: - static scoped_ptr<UpdateChecker> Create( + static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return scoped_ptr<UpdateChecker>(new FakeUpdateChecker()); + return std::unique_ptr<UpdateChecker>(new FakeUpdateChecker()); } bool CheckForUpdates( @@ -599,11 +600,11 @@ TEST_F(UpdateClientTest, TwoCrxUpdate) { class FakeCrxDownloader : public CrxDownloader { public: - static scoped_ptr<CrxDownloader> Create( + static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter, const scoped_refptr<base::SequencedTaskRunner>& task_runner) { - return scoped_ptr<CrxDownloader>(new FakeCrxDownloader()); + return std::unique_ptr<CrxDownloader>(new FakeCrxDownloader()); } private: @@ -681,7 +682,7 @@ TEST_F(UpdateClientTest, TwoCrxUpdate) { } }; - scoped_ptr<FakePingManager> ping_manager(new FakePingManager(config())); + std::unique_ptr<FakePingManager> ping_manager(new FakePingManager(config())); scoped_refptr<UpdateClient> update_client(new UpdateClientImpl( config(), std::move(ping_manager), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create)); @@ -766,10 +767,10 @@ TEST_F(UpdateClientTest, TwoCrxUpdateDownloadTimeout) { class FakeUpdateChecker : public UpdateChecker { public: - static scoped_ptr<UpdateChecker> Create( + static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return scoped_ptr<UpdateChecker>(new FakeUpdateChecker()); + return std::unique_ptr<UpdateChecker>(new FakeUpdateChecker()); } bool CheckForUpdates( @@ -847,11 +848,11 @@ TEST_F(UpdateClientTest, TwoCrxUpdateDownloadTimeout) { class FakeCrxDownloader : public CrxDownloader { public: - static scoped_ptr<CrxDownloader> Create( + static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter, const scoped_refptr<base::SequencedTaskRunner>& task_runner) { - return scoped_ptr<CrxDownloader>(new FakeCrxDownloader()); + return std::unique_ptr<CrxDownloader>(new FakeCrxDownloader()); } private: @@ -929,7 +930,7 @@ TEST_F(UpdateClientTest, TwoCrxUpdateDownloadTimeout) { } }; - scoped_ptr<FakePingManager> ping_manager(new FakePingManager(config())); + std::unique_ptr<FakePingManager> ping_manager(new FakePingManager(config())); scoped_refptr<UpdateClient> update_client(new UpdateClientImpl( config(), std::move(ping_manager), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create)); @@ -1017,10 +1018,10 @@ TEST_F(UpdateClientTest, OneCrxDiffUpdate) { class FakeUpdateChecker : public UpdateChecker { public: - static scoped_ptr<UpdateChecker> Create( + static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return scoped_ptr<UpdateChecker>(new FakeUpdateChecker()); + return std::unique_ptr<UpdateChecker>(new FakeUpdateChecker()); } bool CheckForUpdates( @@ -1120,11 +1121,11 @@ TEST_F(UpdateClientTest, OneCrxDiffUpdate) { class FakeCrxDownloader : public CrxDownloader { public: - static scoped_ptr<CrxDownloader> Create( + static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter, const scoped_refptr<base::SequencedTaskRunner>& task_runner) { - return scoped_ptr<CrxDownloader>(new FakeCrxDownloader()); + return std::unique_ptr<CrxDownloader>(new FakeCrxDownloader()); } private: @@ -1202,7 +1203,7 @@ TEST_F(UpdateClientTest, OneCrxDiffUpdate) { } }; - scoped_ptr<FakePingManager> ping_manager(new FakePingManager(config())); + std::unique_ptr<FakePingManager> ping_manager(new FakePingManager(config())); scoped_refptr<UpdateClient> update_client(new UpdateClientImpl( config(), std::move(ping_manager), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create)); @@ -1309,10 +1310,10 @@ TEST_F(UpdateClientTest, OneCrxInstallError) { class FakeUpdateChecker : public UpdateChecker { public: - static scoped_ptr<UpdateChecker> Create( + static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return scoped_ptr<UpdateChecker>(new FakeUpdateChecker()); + return std::unique_ptr<UpdateChecker>(new FakeUpdateChecker()); } bool CheckForUpdates( @@ -1362,11 +1363,11 @@ TEST_F(UpdateClientTest, OneCrxInstallError) { class FakeCrxDownloader : public CrxDownloader { public: - static scoped_ptr<CrxDownloader> Create( + static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter, const scoped_refptr<base::SequencedTaskRunner>& task_runner) { - return scoped_ptr<CrxDownloader>(new FakeCrxDownloader()); + return std::unique_ptr<CrxDownloader>(new FakeCrxDownloader()); } private: @@ -1419,7 +1420,7 @@ TEST_F(UpdateClientTest, OneCrxInstallError) { } }; - scoped_ptr<PingManager> ping_manager(new FakePingManager(config())); + std::unique_ptr<PingManager> ping_manager(new FakePingManager(config())); scoped_refptr<UpdateClient> update_client(new UpdateClientImpl( config(), std::move(ping_manager), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create)); @@ -1493,10 +1494,10 @@ TEST_F(UpdateClientTest, OneCrxDiffUpdateFailsFullUpdateSucceeds) { class FakeUpdateChecker : public UpdateChecker { public: - static scoped_ptr<UpdateChecker> Create( + static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return scoped_ptr<UpdateChecker>(new FakeUpdateChecker()); + return std::unique_ptr<UpdateChecker>(new FakeUpdateChecker()); } bool CheckForUpdates( @@ -1596,11 +1597,11 @@ TEST_F(UpdateClientTest, OneCrxDiffUpdateFailsFullUpdateSucceeds) { class FakeCrxDownloader : public CrxDownloader { public: - static scoped_ptr<CrxDownloader> Create( + static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter, const scoped_refptr<base::SequencedTaskRunner>& task_runner) { - return scoped_ptr<CrxDownloader>(new FakeCrxDownloader()); + return std::unique_ptr<CrxDownloader>(new FakeCrxDownloader()); } private: @@ -1694,7 +1695,7 @@ TEST_F(UpdateClientTest, OneCrxDiffUpdateFailsFullUpdateSucceeds) { } }; - scoped_ptr<FakePingManager> ping_manager(new FakePingManager(config())); + std::unique_ptr<FakePingManager> ping_manager(new FakePingManager(config())); scoped_refptr<UpdateClient> update_client(new UpdateClientImpl( config(), std::move(ping_manager), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create)); @@ -1783,10 +1784,10 @@ TEST_F(UpdateClientTest, OneCrxNoUpdateQueuedCall) { class FakeUpdateChecker : public UpdateChecker { public: - static scoped_ptr<UpdateChecker> Create( + static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return scoped_ptr<UpdateChecker>(new FakeUpdateChecker()); + return std::unique_ptr<UpdateChecker>(new FakeUpdateChecker()); } bool CheckForUpdates( @@ -1802,11 +1803,11 @@ TEST_F(UpdateClientTest, OneCrxNoUpdateQueuedCall) { class FakeCrxDownloader : public CrxDownloader { public: - static scoped_ptr<CrxDownloader> Create( + static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter, const scoped_refptr<base::SequencedTaskRunner>& task_runner) { - return scoped_ptr<CrxDownloader>(new FakeCrxDownloader()); + return std::unique_ptr<CrxDownloader>(new FakeCrxDownloader()); } private: @@ -1824,7 +1825,7 @@ TEST_F(UpdateClientTest, OneCrxNoUpdateQueuedCall) { ~FakePingManager() override { EXPECT_TRUE(items().empty()); } }; - scoped_ptr<PingManager> ping_manager(new FakePingManager(config())); + std::unique_ptr<PingManager> ping_manager(new FakePingManager(config())); scoped_refptr<UpdateClient> update_client(new UpdateClientImpl( config(), std::move(ping_manager), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create)); @@ -1883,10 +1884,10 @@ TEST_F(UpdateClientTest, OneCrxInstall) { class FakeUpdateChecker : public UpdateChecker { public: - static scoped_ptr<UpdateChecker> Create( + static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return scoped_ptr<UpdateChecker>(new FakeUpdateChecker()); + return std::unique_ptr<UpdateChecker>(new FakeUpdateChecker()); } bool CheckForUpdates( @@ -1936,11 +1937,11 @@ TEST_F(UpdateClientTest, OneCrxInstall) { class FakeCrxDownloader : public CrxDownloader { public: - static scoped_ptr<CrxDownloader> Create( + static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter, const scoped_refptr<base::SequencedTaskRunner>& task_runner) { - return scoped_ptr<CrxDownloader>(new FakeCrxDownloader()); + return std::unique_ptr<CrxDownloader>(new FakeCrxDownloader()); } private: @@ -1997,7 +1998,7 @@ TEST_F(UpdateClientTest, OneCrxInstall) { } }; - scoped_ptr<FakePingManager> ping_manager(new FakePingManager(config())); + std::unique_ptr<FakePingManager> ping_manager(new FakePingManager(config())); scoped_refptr<UpdateClient> update_client(new UpdateClientImpl( config(), std::move(ping_manager), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create)); @@ -2070,10 +2071,10 @@ TEST_F(UpdateClientTest, ConcurrentInstallSameCRX) { class FakeUpdateChecker : public UpdateChecker { public: - static scoped_ptr<UpdateChecker> Create( + static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return scoped_ptr<UpdateChecker>(new FakeUpdateChecker()); + return std::unique_ptr<UpdateChecker>(new FakeUpdateChecker()); } bool CheckForUpdates( @@ -2089,11 +2090,11 @@ TEST_F(UpdateClientTest, ConcurrentInstallSameCRX) { class FakeCrxDownloader : public CrxDownloader { public: - static scoped_ptr<CrxDownloader> Create( + static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter, const scoped_refptr<base::SequencedTaskRunner>& task_runner) { - return scoped_ptr<CrxDownloader>(new FakeCrxDownloader()); + return std::unique_ptr<CrxDownloader>(new FakeCrxDownloader()); } private: @@ -2111,7 +2112,7 @@ TEST_F(UpdateClientTest, ConcurrentInstallSameCRX) { ~FakePingManager() override { EXPECT_TRUE(items().empty()); } }; - scoped_ptr<FakePingManager> ping_manager(new FakePingManager(config())); + std::unique_ptr<FakePingManager> ping_manager(new FakePingManager(config())); scoped_refptr<UpdateClient> update_client(new UpdateClientImpl( config(), std::move(ping_manager), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create)); @@ -2164,10 +2165,10 @@ TEST_F(UpdateClientTest, EmptyIdList) { }; class FakeUpdateChecker : public UpdateChecker { public: - static scoped_ptr<UpdateChecker> Create( + static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return scoped_ptr<UpdateChecker>(new FakeUpdateChecker()); + return std::unique_ptr<UpdateChecker>(new FakeUpdateChecker()); } bool CheckForUpdates( @@ -2180,11 +2181,11 @@ TEST_F(UpdateClientTest, EmptyIdList) { class FakeCrxDownloader : public CrxDownloader { public: - static scoped_ptr<CrxDownloader> Create( + static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter, const scoped_refptr<base::SequencedTaskRunner>& task_runner) { - return scoped_ptr<CrxDownloader>(new FakeCrxDownloader()); + return std::unique_ptr<CrxDownloader>(new FakeCrxDownloader()); } private: @@ -2196,7 +2197,7 @@ TEST_F(UpdateClientTest, EmptyIdList) { }; scoped_refptr<UpdateClient> update_client(new UpdateClientImpl( - config(), make_scoped_ptr(new FakePingManagerImpl(config())), + config(), base::WrapUnique(new FakePingManagerImpl(config())), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create)); std::vector<std::string> empty_id_list; @@ -2210,7 +2211,7 @@ TEST_F(UpdateClientTest, EmptyIdList) { TEST_F(UpdateClientTest, SendUninstallPing) { class FakeUpdateChecker : public UpdateChecker { public: - static scoped_ptr<UpdateChecker> Create( + static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { return nullptr; @@ -2226,7 +2227,7 @@ TEST_F(UpdateClientTest, SendUninstallPing) { class FakeCrxDownloader : public CrxDownloader { public: - static scoped_ptr<CrxDownloader> Create( + static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter, const scoped_refptr<base::SequencedTaskRunner>& task_runner) { @@ -2255,7 +2256,7 @@ TEST_F(UpdateClientTest, SendUninstallPing) { } }; - scoped_ptr<PingManager> ping_manager(new FakePingManager(config())); + std::unique_ptr<PingManager> ping_manager(new FakePingManager(config())); scoped_refptr<UpdateClient> update_client(new UpdateClientImpl( config(), std::move(ping_manager), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create)); @@ -2308,10 +2309,10 @@ TEST_F(UpdateClientTest, RetryAfter) { class FakeUpdateChecker : public UpdateChecker { public: - static scoped_ptr<UpdateChecker> Create( + static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return scoped_ptr<UpdateChecker>(new FakeUpdateChecker()); + return std::unique_ptr<UpdateChecker>(new FakeUpdateChecker()); } bool CheckForUpdates( @@ -2338,11 +2339,11 @@ TEST_F(UpdateClientTest, RetryAfter) { class FakeCrxDownloader : public CrxDownloader { public: - static scoped_ptr<CrxDownloader> Create( + static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter, const scoped_refptr<base::SequencedTaskRunner>& task_runner) { - return scoped_ptr<CrxDownloader>(new FakeCrxDownloader()); + return std::unique_ptr<CrxDownloader>(new FakeCrxDownloader()); } private: @@ -2360,7 +2361,7 @@ TEST_F(UpdateClientTest, RetryAfter) { ~FakePingManager() override { EXPECT_TRUE(items().empty()); } }; - scoped_ptr<PingManager> ping_manager(new FakePingManager(config())); + std::unique_ptr<PingManager> ping_manager(new FakePingManager(config())); scoped_refptr<UpdateClient> update_client(new UpdateClientImpl( config(), std::move(ping_manager), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create)); diff --git a/chromium/components/update_client/update_engine.cc b/chromium/components/update_client/update_engine.cc index b9959a235a1..e356e99b7f7 100644 --- a/chromium/components/update_client/update_engine.cc +++ b/chromium/components/update_client/update_engine.cc @@ -8,7 +8,7 @@ #include "base/bind_helpers.h" #include "base/location.h" #include "base/stl_util.h" -#include "base/thread_task_runner_handle.h" +#include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" #include "components/prefs/pref_service.h" #include "components/update_client/action_update_check.h" @@ -93,13 +93,13 @@ void UpdateEngine::Update( return; } - scoped_ptr<UpdateContext> update_context(new UpdateContext( + std::unique_ptr<UpdateContext> update_context(new UpdateContext( config_, is_foreground, ids, crx_data_callback, notify_observers_callback_, callback, update_checker_factory_, crx_downloader_factory_, ping_manager_)); CrxUpdateItem update_item; - scoped_ptr<ActionUpdateCheck> update_check_action(new ActionUpdateCheck( + std::unique_ptr<ActionUpdateCheck> update_check_action(new ActionUpdateCheck( (*update_context->update_checker_factory)(config_, metadata_.get()), config_->GetBrowserVersion(), config_->ExtraRequestParams())); diff --git a/chromium/components/update_client/update_engine.h b/chromium/components/update_client/update_engine.h index 33e5f2e9ed6..a82864cb009 100644 --- a/chromium/components/update_client/update_engine.h +++ b/chromium/components/update_client/update_engine.h @@ -6,6 +6,7 @@ #define COMPONENTS_UPDATE_CLIENT_UPDATE_ENGINE_H_ #include <list> +#include <memory> #include <queue> #include <set> #include <string> @@ -14,7 +15,6 @@ #include "base/callback.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/threading/thread_checker.h" #include "components/update_client/action.h" #include "components/update_client/component_patcher_operation.h" @@ -140,7 +140,7 @@ struct UpdateContext { PingManager* ping_manager; // Not owned by this class. - scoped_ptr<Action> current_action; + std::unique_ptr<Action> current_action; // TODO(sorin): use a map instead of vector. std::vector<CrxUpdateItem*> update_items; diff --git a/chromium/components/update_client/update_query_params.cc b/chromium/components/update_client/update_query_params.cc index 1cd20737f1d..42c8c91ff52 100644 --- a/chromium/components/update_client/update_query_params.cc +++ b/chromium/components/update_client/update_query_params.cc @@ -44,6 +44,8 @@ const char kArch[] = "arm"; #elif defined(__aarch64__) "arm64"; +#elif defined(__mips__) && (__mips == 64) + "mips64el"; #elif defined(__mips__) "mipsel"; #else @@ -115,6 +117,8 @@ const char* UpdateQueryParams::GetNaclArch() { return "arm64"; #elif defined(ARCH_CPU_MIPSEL) return "mips32"; +#elif defined(ARCH_CPU_MIPS64EL) + return "mips64"; #else // NOTE: when adding new values here, please remember to update the // comment in the .h file about possible return values from this function. diff --git a/chromium/components/update_client/update_response.cc b/chromium/components/update_client/update_response.cc index 3d8d14d5305..e89a774ae7a 100644 --- a/chromium/components/update_client/update_response.cc +++ b/chromium/components/update_client/update_response.cc @@ -7,8 +7,8 @@ #include <stddef.h> #include <algorithm> +#include <memory> -#include "base/memory/scoped_ptr.h" #include "base/stl_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" diff --git a/chromium/components/update_client/url_fetcher_downloader.cc b/chromium/components/update_client/url_fetcher_downloader.cc index 3a47c88e987..6a74d881263 100644 --- a/chromium/components/update_client/url_fetcher_downloader.cc +++ b/chromium/components/update_client/url_fetcher_downloader.cc @@ -20,7 +20,7 @@ namespace update_client { UrlFetcherDownloader::UrlFetcherDownloader( - scoped_ptr<CrxDownloader> successor, + std::unique_ptr<CrxDownloader> successor, net::URLRequestContextGetter* context_getter, const scoped_refptr<base::SequencedTaskRunner>& task_runner) : CrxDownloader(task_runner, std::move(successor)), diff --git a/chromium/components/update_client/url_fetcher_downloader.h b/chromium/components/update_client/url_fetcher_downloader.h index e75a3016626..4f2fbdec4db 100644 --- a/chromium/components/update_client/url_fetcher_downloader.h +++ b/chromium/components/update_client/url_fetcher_downloader.h @@ -7,9 +7,10 @@ #include <stdint.h> +#include <memory> + #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/threading/thread_checker.h" #include "base/time/time.h" #include "components/update_client/crx_downloader.h" @@ -32,7 +33,7 @@ class UrlFetcherDownloader : public CrxDownloader, protected: friend class CrxDownloader; UrlFetcherDownloader( - scoped_ptr<CrxDownloader> successor, + std::unique_ptr<CrxDownloader> successor, net::URLRequestContextGetter* context_getter, const scoped_refptr<base::SequencedTaskRunner>& task_runner); ~UrlFetcherDownloader() override; @@ -46,7 +47,7 @@ class UrlFetcherDownloader : public CrxDownloader, void OnURLFetchDownloadProgress(const net::URLFetcher* source, int64_t current, int64_t total) override; - scoped_ptr<net::URLFetcher> url_fetcher_; + std::unique_ptr<net::URLFetcher> url_fetcher_; net::URLRequestContextGetter* context_getter_; base::Time download_start_time_; diff --git a/chromium/components/update_client/url_request_post_interceptor.cc b/chromium/components/update_client/url_request_post_interceptor.cc index caf179a3bcd..38501606120 100644 --- a/chromium/components/update_client/url_request_post_interceptor.cc +++ b/chromium/components/update_client/url_request_post_interceptor.cc @@ -4,9 +4,10 @@ #include "components/update_client/url_request_post_interceptor.h" +#include <memory> + #include "base/files/file_util.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/strings/stringprintf.h" #include "components/update_client/test_configurator.h" #include "net/base/upload_bytes_element_reader.h" @@ -147,7 +148,7 @@ class URLRequestPostInterceptor::Delegate : public net::URLRequestInterceptor { void Register() { DCHECK(io_task_runner_->RunsTasksOnCurrentThread()); net::URLRequestFilter::GetInstance()->AddHostnameInterceptor( - scheme_, hostname_, scoped_ptr<net::URLRequestInterceptor>(this)); + scheme_, hostname_, std::unique_ptr<net::URLRequestInterceptor>(this)); } void Unregister() { diff --git a/chromium/components/update_client/utils.cc b/chromium/components/update_client/utils.cc index 236c27071c7..90bbc1197f9 100644 --- a/chromium/components/update_client/utils.cc +++ b/chromium/components/update_client/utils.cc @@ -129,12 +129,12 @@ std::string BuildProtocolRequest(const std::string& browser_version, return request; } -scoped_ptr<net::URLFetcher> SendProtocolRequest( +std::unique_ptr<net::URLFetcher> SendProtocolRequest( const GURL& url, const std::string& protocol_request, net::URLFetcherDelegate* url_fetcher_delegate, net::URLRequestContextGetter* url_request_context_getter) { - scoped_ptr<net::URLFetcher> url_fetcher = net::URLFetcher::Create( + std::unique_ptr<net::URLFetcher> url_fetcher = net::URLFetcher::Create( 0, url, net::URLFetcher::POST, url_fetcher_delegate); if (!url_fetcher.get()) return url_fetcher; @@ -221,7 +221,7 @@ bool VerifyFileHash256(const base::FilePath& filepath, return false; uint8_t actual_hash[crypto::kSHA256Length] = {0}; - scoped_ptr<crypto::SecureHash> hasher( + std::unique_ptr<crypto::SecureHash> hasher( crypto::SecureHash::Create(crypto::SecureHash::SHA256)); hasher->Update(mmfile.data(), mmfile.length()); hasher->Finish(actual_hash, sizeof(actual_hash)); diff --git a/chromium/components/update_client/utils.h b/chromium/components/update_client/utils.h index ce0efeaaad9..2306cf2a837 100644 --- a/chromium/components/update_client/utils.h +++ b/chromium/components/update_client/utils.h @@ -5,10 +5,10 @@ #ifndef COMPONENTS_UPDATE_CLIENT_UTILS_H_ #define COMPONENTS_UPDATE_CLIENT_UTILS_H_ +#include <memory> #include <string> #include <vector> -#include "base/memory/scoped_ptr.h" class GURL; @@ -61,7 +61,7 @@ std::string BuildProtocolRequest(const std::string& browser_version, // Sends a protocol request to the the service endpoint specified by |url|. // The body of the request is provided by |protocol_request| and it is // expected to contain XML data. The caller owns the returned object. -scoped_ptr<net::URLFetcher> SendProtocolRequest( +std::unique_ptr<net::URLFetcher> SendProtocolRequest( const GURL& url, const std::string& protocol_request, net::URLFetcherDelegate* url_fetcher_delegate, |