0

Make GetCommandExecuteImplClsid return the CLSID as a string directly.

BUG=Unjustified single out-param.

Review URL: https://codereview.chromium.org/1321143002

Cr-Commit-Position: refs/heads/master@{#346915}
This commit is contained in:
gab
2015-09-02 07:44:10 -07:00
committed by Commit bot
parent 3adf304a12
commit c62bb4ac21
14 changed files with 24 additions and 37 deletions

@@ -1255,9 +1255,9 @@ void AddDelegateExecuteWorkItems(const InstallerState& installer_state,
const Version& new_version, const Version& new_version,
const Product& product, const Product& product,
WorkItemList* list) { WorkItemList* list) {
base::string16 handler_class_uuid;
BrowserDistribution* dist = product.distribution(); BrowserDistribution* dist = product.distribution();
if (!dist->GetCommandExecuteImplClsid(&handler_class_uuid)) { const base::string16 handler_class_uuid = dist->GetCommandExecuteImplClsid();
if (handler_class_uuid.empty()) {
if (InstallUtil::IsChromeSxSProcess()) { if (InstallUtil::IsChromeSxSProcess()) {
CleanupBadCanaryDelegateExecuteRegistration(target_path, list); CleanupBadCanaryDelegateExecuteRegistration(target_path, list);
} else { } else {

@@ -257,11 +257,8 @@ bool BrowserDistribution::GetChromeChannel(base::string16* channel) {
return false; return false;
} }
bool BrowserDistribution::GetCommandExecuteImplClsid( base::string16 BrowserDistribution::GetCommandExecuteImplClsid() {
base::string16* handler_class_uuid) { return kCommandExecuteImplUuid;
if (handler_class_uuid)
*handler_class_uuid = kCommandExecuteImplUuid;
return true;
} }
void BrowserDistribution::UpdateInstallStatus(bool system_install, void BrowserDistribution::UpdateInstallStatus(bool system_install,

@@ -140,10 +140,9 @@ class BrowserDistribution {
virtual bool GetChromeChannel(base::string16* channel); virtual bool GetChromeChannel(base::string16* channel);
// Returns true if this distribution includes a DelegateExecute verb handler, // Returns the CommandExecuteImpl class UUID (or empty string if this
// and provides the CommandExecuteImpl class UUID if |handler_class_uuid| is // distribution doesn't include a DelegateExecute verb handler).
// non-NULL. virtual base::string16 GetCommandExecuteImplClsid();
virtual bool GetCommandExecuteImplClsid(base::string16* handler_class_uuid);
virtual void UpdateInstallStatus(bool system_install, virtual void UpdateInstallStatus(bool system_install,
installer::ArchiveType archive_type, installer::ArchiveType archive_type,

@@ -108,9 +108,8 @@ bool ChromeFrameDistribution::CanCreateDesktopShortcuts() {
return false; return false;
} }
bool ChromeFrameDistribution::GetCommandExecuteImplClsid( base::string16 ChromeFrameDistribution::GetCommandExecuteImplClsid() {
base::string16* handler_class_uuid) { return base::string16();
return false;
} }
void ChromeFrameDistribution::UpdateInstallStatus(bool system_install, void ChromeFrameDistribution::UpdateInstallStatus(bool system_install,

@@ -43,7 +43,7 @@ class ChromeFrameDistribution : public BrowserDistribution {
bool CanCreateDesktopShortcuts() override; bool CanCreateDesktopShortcuts() override;
bool GetCommandExecuteImplClsid(base::string16* handler_class_uuid) override; base::string16 GetCommandExecuteImplClsid() override;
void UpdateInstallStatus(bool system_install, void UpdateInstallStatus(bool system_install,
installer::ArchiveType archive_type, installer::ArchiveType archive_type,

@@ -106,7 +106,6 @@ bool ChromiumBinariesDistribution::GetChromeChannel(base::string16* channel) {
return false; return false;
} }
bool ChromiumBinariesDistribution::GetCommandExecuteImplClsid( base::string16 ChromiumBinariesDistribution::GetCommandExecuteImplClsid() {
base::string16* handler_class_uuid) { return base::string16();
return false;
} }

@@ -44,7 +44,7 @@ class ChromiumBinariesDistribution : public BrowserDistribution {
bool GetChromeChannel(base::string16* channel) override; bool GetChromeChannel(base::string16* channel) override;
bool GetCommandExecuteImplClsid(base::string16* handler_class_uuid) override; base::string16 GetCommandExecuteImplClsid() override;
protected: protected:
friend class BrowserDistribution; friend class BrowserDistribution;

@@ -236,11 +236,8 @@ base::string16 GoogleChromeDistribution::GetIconFilename() {
return installer::kChromeExe; return installer::kChromeExe;
} }
bool GoogleChromeDistribution::GetCommandExecuteImplClsid( base::string16 GoogleChromeDistribution::GetCommandExecuteImplClsid() {
base::string16* handler_class_uuid) { return kCommandExecuteImplUuid;
if (handler_class_uuid)
*handler_class_uuid = kCommandExecuteImplUuid;
return true;
} }
// This method checks if we need to change "ap" key in Google Update to try // This method checks if we need to change "ap" key in Google Update to try

@@ -65,7 +65,7 @@ class GoogleChromeDistribution : public BrowserDistribution {
base::string16 GetUninstallRegPath() override; base::string16 GetUninstallRegPath() override;
bool GetCommandExecuteImplClsid(base::string16* handler_class_uuid) override; base::string16 GetCommandExecuteImplClsid() override;
void UpdateInstallStatus( void UpdateInstallStatus(
bool system_install, bool system_install,

@@ -93,9 +93,8 @@ base::string16 GoogleChromeDistribution::GetIconFilename() {
return base::string16(); return base::string16();
} }
bool GoogleChromeDistribution::GetCommandExecuteImplClsid( base::string16 GoogleChromeDistribution::GetCommandExecuteImplClsid() {
base::string16* handler_class_uuid) { return base::string16();
return false;
} }
void GoogleChromeDistribution::UpdateInstallStatus(bool system_install, void GoogleChromeDistribution::UpdateInstallStatus(bool system_install,

@@ -102,11 +102,8 @@ bool GoogleChromeSxSDistribution::GetChromeChannel(base::string16* channel) {
return true; return true;
} }
bool GoogleChromeSxSDistribution::GetCommandExecuteImplClsid( base::string16 GoogleChromeSxSDistribution::GetCommandExecuteImplClsid() {
base::string16* handler_class_uuid) { return kCommandExecuteImplUuid;
if (handler_class_uuid)
*handler_class_uuid = kCommandExecuteImplUuid;
return true;
} }
bool GoogleChromeSxSDistribution::ShouldSetExperimentLabels() { bool GoogleChromeSxSDistribution::ShouldSetExperimentLabels() {

@@ -31,7 +31,7 @@ class GoogleChromeSxSDistribution : public GoogleChromeDistribution {
base::string16 GetUninstallRegPath() override; base::string16 GetUninstallRegPath() override;
DefaultBrowserControlPolicy GetDefaultBrowserControlPolicy() override; DefaultBrowserControlPolicy GetDefaultBrowserControlPolicy() override;
bool GetChromeChannel(base::string16* channel) override; bool GetChromeChannel(base::string16* channel) override;
bool GetCommandExecuteImplClsid(base::string16* handler_class_uuid) override; base::string16 GetCommandExecuteImplClsid() override;
bool ShouldSetExperimentLabels() override; bool ShouldSetExperimentLabels() override;
bool HasUserExperiments() override; bool HasUserExperiments() override;
// returns the channel name for GoogleChromeSxSDistribution // returns the channel name for GoogleChromeSxSDistribution

@@ -336,7 +336,7 @@ class RegistryEntry {
app_info.application_description = dist->GetAppDescription(); app_info.application_description = dist->GetAppDescription();
app_info.publisher_name = dist->GetPublisherName(); app_info.publisher_name = dist->GetPublisherName();
dist->GetCommandExecuteImplClsid(&app_info.delegate_clsid); app_info.delegate_clsid = dist->GetCommandExecuteImplClsid();
GetProgIdEntries(app_info, entries); GetProgIdEntries(app_info, entries);

@@ -46,10 +46,10 @@ class DelegateExecuteModule
HRESULT PreMessageLoop(int nShowCmd) { HRESULT PreMessageLoop(int nShowCmd) {
HRESULT hr = S_OK; HRESULT hr = S_OK;
base::string16 clsid_string;
GUID clsid; GUID clsid;
BrowserDistribution* dist = BrowserDistribution::GetDistribution(); BrowserDistribution* dist = BrowserDistribution::GetDistribution();
if (!dist->GetCommandExecuteImplClsid(&clsid_string)) const base::string16 clsid_string = dist->GetCommandExecuteImplClsid();
if (clsid_string.empty())
return E_FAIL; return E_FAIL;
hr = ::CLSIDFromString(clsid_string.c_str(), &clsid); hr = ::CLSIDFromString(clsid_string.c_str(), &clsid);
if (FAILED(hr)) if (FAILED(hr))