diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-20 13:40:20 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-22 12:41:23 +0000 |
commit | 7961cea6d1041e3e454dae6a1da660b453efd238 (patch) | |
tree | c0eeb4a9ff9ba32986289c1653d9608e53ccb444 /chromium/chrome/browser/extensions/api/developer_private/developer_private_api.cc | |
parent | b7034d0803538058e5c9d904ef03cf5eab34f6ef (diff) |
BASELINE: Update Chromium to 78.0.3904.130
Change-Id: If185e0c0061b3437531c97c9c8c78f239352a68b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/chrome/browser/extensions/api/developer_private/developer_private_api.cc')
-rw-r--r-- | chromium/chrome/browser/extensions/api/developer_private/developer_private_api.cc | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/chromium/chrome/browser/extensions/api/developer_private/developer_private_api.cc b/chromium/chrome/browser/extensions/api/developer_private/developer_private_api.cc index a923c4d2d71..6cd0dd1f2f8 100644 --- a/chromium/chrome/browser/extensions/api/developer_private/developer_private_api.cc +++ b/chromium/chrome/browser/extensions/api/developer_private/developer_private_api.cc @@ -14,6 +14,7 @@ #include "base/files/file_util.h" #include "base/guid.h" #include "base/lazy_instance.h" +#include "base/memory/scoped_refptr.h" #include "base/metrics/histogram_macros.h" #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" @@ -176,8 +177,9 @@ void GetManifestError(const std::string& error, // This will read the manifest and call AddFailure with the read manifest // contents. - base::PostTaskWithTraitsAndReplyWithResult( - FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_BLOCKING}, + base::PostTaskAndReplyWithResult( + FROM_HERE, + {base::ThreadPool(), base::MayBlock(), base::TaskPriority::USER_BLOCKING}, base::BindOnce(&ReadFileToString, extension_path.Append(kManifestFilename)), base::BindOnce(std::move(callback), extension_path, error, line)); @@ -1472,9 +1474,10 @@ bool DeveloperPrivateLoadDirectoryFunction::LoadByFileSystemAPI( project_base_path_ = project_path; - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, - {base::MayBlock(), base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}, + {base::ThreadPool(), base::MayBlock(), + base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}, base::BindOnce( &DeveloperPrivateLoadDirectoryFunction::ClearExistingDirectoryContent, this, project_base_path_)); @@ -1498,7 +1501,7 @@ void DeveloperPrivateLoadDirectoryFunction::ClearExistingDirectoryContent( pending_copy_operations_count_ = 1; - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {content::BrowserThread::IO}, base::BindOnce( &DeveloperPrivateLoadDirectoryFunction::ReadDirectoryByFileSystemAPI, @@ -1563,7 +1566,7 @@ void DeveloperPrivateLoadDirectoryFunction::ReadDirectoryByFileSystemAPICb( pending_copy_operations_count_--; if (!pending_copy_operations_count_) { - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {content::BrowserThread::UI}, base::BindOnce(&DeveloperPrivateLoadDirectoryFunction::SendResponse, this, success_)); @@ -1583,9 +1586,10 @@ void DeveloperPrivateLoadDirectoryFunction::SnapshotFileCallback( return; } - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, - {base::MayBlock(), base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}, + {base::ThreadPool(), base::MayBlock(), + base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}, base::BindOnce(&DeveloperPrivateLoadDirectoryFunction::CopyFile, this, src_path, target_path)); } @@ -1605,7 +1609,7 @@ void DeveloperPrivateLoadDirectoryFunction::CopyFile( pending_copy_operations_count_--; if (!pending_copy_operations_count_) { - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {content::BrowserThread::UI}, base::BindOnce(&DeveloperPrivateLoadDirectoryFunction::Load, this)); } @@ -1710,8 +1714,9 @@ DeveloperPrivateRequestFileSourceFunction::Run() { if (properties.path_suffix == kManifestFile && !properties.manifest_key) return RespondNow(Error(kManifestKeyIsRequiredError)); - base::PostTaskWithTraitsAndReplyWithResult( - FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE}, + base::PostTaskAndReplyWithResult( + FROM_HERE, + {base::ThreadPool(), base::MayBlock(), base::TaskPriority::USER_VISIBLE}, base::Bind(&ReadFileToString, extension->path().Append(path_suffix)), base::Bind(&DeveloperPrivateRequestFileSourceFunction::Finish, this)); @@ -1817,7 +1822,7 @@ DeveloperPrivateOpenDevToolsFunction::Run() { // ... but some pages (popups and apps) don't have tabs, and some (background // pages) don't have an associated browser. For these, the inspector opens in // a new window, and our work is done. - if (!browser || !browser->is_type_tabbed()) + if (!browser || !browser->is_type_normal()) return RespondNow(NoArguments()); TabStripModel* tab_strip = browser->tab_strip_model(); @@ -1886,11 +1891,10 @@ DeveloperPrivateRepairExtensionFunction::Run() { if (!web_contents) return RespondNow(Error(kCouldNotFindWebContentsError)); - scoped_refptr<WebstoreReinstaller> reinstaller(new WebstoreReinstaller( + auto reinstaller = base::MakeRefCounted<WebstoreReinstaller>( web_contents, params->extension_id, base::BindOnce( - &DeveloperPrivateRepairExtensionFunction::OnReinstallComplete, - this))); + &DeveloperPrivateRepairExtensionFunction::OnReinstallComplete, this)); reinstaller->BeginReinstall(); return RespondLater(); |