summaryrefslogtreecommitdiffstats
path: root/base/win
diff options
context:
space:
mode:
authorGabriel Charette <gab@chromium.org>2014-09-09 15:24:28 -0400
committerGabriel Charette <gab@chromium.org>2014-09-09 19:41:38 +0000
commit8d5adf5b8a017eeb9e3a6972b77725a1a8b1709b (patch)
tree7c2798f07a3b8698c297331bb114384b6186cc7a /base/win
parente7ccb7eb32d74ae96f8f6ee7b038a02c4cffe491 (diff)
downloadchromium_src-8d5adf5b8a017eeb9e3a6972b77725a1a8b1709b.zip
chromium_src-8d5adf5b8a017eeb9e3a6972b77725a1a8b1709b.tar.gz
chromium_src-8d5adf5b8a017eeb9e3a6972b77725a1a8b1709b.tar.bz2
Remove the IShellLink::Resolve step in ResolveShortcutProperties.
This call was only useful if we cared to have Windows attempt to find the target should the path have moved. Since moving Chrome installs (or installing them on anything but a local C: drive) is unsupported there is no need to do this. This code only cares about the target path currently stored in the shortcut (regardless of its existence) -- for which GetPath() is sufficient. This call could otherwise take up to 3 seconds per unresolvable shortcut which can drastically impact uninstall times when setup.exe attempts to delete all shortcuts pointing to its chrome.exe in common shortcut paths. This should also get rid of LOG(ERROR)s in test_installer about unresolveable shortcuts as we will now only inspect the path stored in the shortcut without trying to actually resolve it. BUG=412380 R=cpu@chromium.org, grt@chromium.org Review URL: https://codereview.chromium.org/553783005 Cr-Commit-Position: refs/heads/master@{#293986}
Diffstat (limited to 'base/win')
-rw-r--r--base/win/shortcut.cc3
-rw-r--r--base/win/shortcut.h10
2 files changed, 6 insertions, 7 deletions
diff --git a/base/win/shortcut.cc b/base/win/shortcut.cc
index f56db9f..eef299b 100644
--- a/base/win/shortcut.cc
+++ b/base/win/shortcut.cc
@@ -204,9 +204,6 @@ bool ResolveShortcutProperties(const FilePath& shortcut_path,
wchar_t temp[MAX_PATH];
if (options & ShortcutProperties::PROPERTIES_TARGET) {
- // Try to find the target of a shortcut.
- if (FAILED(i_shell_link->Resolve(0, SLR_NO_UI | SLR_NOSEARCH)))
- return false;
if (FAILED(i_shell_link->GetPath(temp, MAX_PATH, NULL, SLGP_UNCPRIORITY)))
return false;
properties->set_target(FilePath(temp));
diff --git a/base/win/shortcut.h b/base/win/shortcut.h
index 13940ed..2feb4c3 100644
--- a/base/win/shortcut.h
+++ b/base/win/shortcut.h
@@ -125,14 +125,16 @@ BASE_EXPORT bool CreateOrUpdateShortcutLink(
const ShortcutProperties& properties,
ShortcutOperation operation);
-// Resolves Windows shortcut (.LNK file)
+// Resolves Windows shortcut (.LNK file).
// This methods tries to resolve selected properties of a shortcut .LNK file.
// The path of the shortcut to resolve is in |shortcut_path|. |options| is a bit
// field composed of ShortcutProperties::IndividualProperties, to specify which
// properties to read. It should be non-0. The resulting data are read into
-// |properties|, which must not be NULL. The function returns true if all
-// requested properties are successfully read. Otherwise some reads have failed
-// and intermediate values written to |properties| should be ignored.
+// |properties|, which must not be NULL. Note: PROPERTIES_TARGET will retrieve
+// the target path as stored in the shortcut but won't attempt to resolve that
+// path so it may not be valid. The function returns true if all requested
+// properties are successfully read. Otherwise some reads have failed and
+// intermediate values written to |properties| should be ignored.
BASE_EXPORT bool ResolveShortcutProperties(const FilePath& shortcut_path,
uint32 options,
ShortcutProperties* properties);