summaryrefslogtreecommitdiffstats
path: root/chrome_frame/utils.cc
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-19 03:09:21 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-19 03:09:21 +0000
commitd7265be40af32faedc9491b8ca96059993222ba6 (patch)
treee2f1f665102469eac482c542d9a665e80b15ef92 /chrome_frame/utils.cc
parentc391387ed7ccbd6e252d9d2f4c834c880722f4ac (diff)
downloadchromium_src-d7265be40af32faedc9491b8ca96059993222ba6.zip
chromium_src-d7265be40af32faedc9491b8ca96059993222ba6.tar.gz
chromium_src-d7265be40af32faedc9491b8ca96059993222ba6.tar.bz2
Make UtilChangePersistentNPAPIMarker return true on unregistration if
the marker did not previously exist. BUG=none TEST=call the UnregisterNPAPIPlugin entrypoint on npchrome_tab.dll when the NPAPI plug-in is not previously installed with Firefox; it should not return an error. Review URL: http://codereview.chromium.org/402062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32480 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/utils.cc')
-rw-r--r--chrome_frame/utils.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc
index aa24c1a..61bf7df 100644
--- a/chrome_frame/utils.cc
+++ b/chrome_frame/utils.cc
@@ -168,7 +168,11 @@ bool UtilChangePersistentNPAPIMarker(bool set) {
if (set) {
success = cf_state_key.WriteValue(kChromeFramePersistNPAPIReg, 1);
} else {
- success = cf_state_key.DeleteValue(kChromeFramePersistNPAPIReg);
+ // Unfortunately, DeleteValue returns true only if the value
+ // previously existed, so we do a separate existence check to
+ // validate success.
+ cf_state_key.DeleteValue(kChromeFramePersistNPAPIReg);
+ success = !cf_state_key.ValueExists(kChromeFramePersistNPAPIReg);
}
}
return success;