diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-26 19:49:57 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-26 19:49:57 +0000 |
commit | 48dc9e15affd5237dde74fddfdd243db40e96b36 (patch) | |
tree | ab16b4f3425d740ffea9fbea91df7a6e569903fb /chrome_frame/delete_chrome_history.cc | |
parent | 3d17ea8af46488f32bade8594b8c345fb837fc9a (diff) | |
download | chromium_src-48dc9e15affd5237dde74fddfdd243db40e96b36.zip chromium_src-48dc9e15affd5237dde74fddfdd243db40e96b36.tar.gz chromium_src-48dc9e15affd5237dde74fddfdd243db40e96b36.tar.bz2 |
Submitting for Erik:
(http://codereview.chromium.org/3167040/show)
In IE8, on Vista, when the user deletes their browsing data, the IDeleteBrowsingHistory interface is invoked twice - once in a low integrity process and once in a medium integrity process.
Only the medium integrity process may succeed, but the low integrity process will restart the automation server after failing to connect to it.
Upon invocation by IE, check the integrity level of the current process - if it is low, exit. GetProcessIntegrityLevel was adapted from rlz. A follow-up changeset will modify rlz to use this implementation.
During editing, some unnecessary headers were removed from win_util.h and correspondingly added to win_util.cc and certain clients who were depending on transient includes.
BUG=56212
TEST=Load some pages using Chrome Frame. Close IE. Verify that the Chrome Frame cache has grown and that the accessed domains appear in the history files. Launch IE, load a page using Chrome Frame. Delete Browsing Data. Note that the tab does not crash, that the on-disk cache files shrink, and that the accessed domains no longer appear in the history file
Review URL: http://codereview.chromium.org/3171033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57567 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/delete_chrome_history.cc')
-rw-r--r-- | chrome_frame/delete_chrome_history.cc | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/chrome_frame/delete_chrome_history.cc b/chrome_frame/delete_chrome_history.cc index 1b4b7b9..19eccf3 100644 --- a/chrome_frame/delete_chrome_history.cc +++ b/chrome_frame/delete_chrome_history.cc @@ -5,9 +5,10 @@ // Implementation of DeleteChromeHistory #include "chrome_frame/delete_chrome_history.h" -#include "chrome_frame/chrome_frame_activex.h" #include "chrome/browser/browsing_data_remover.h" -#include "utils.h" + +#include "chrome_frame/chrome_frame_activex.h" +#include "chrome_frame/utils.h" // Below other header to avoid symbol pollution. #define INITGUID @@ -57,6 +58,21 @@ STDMETHODIMP DeleteChromeHistory::DeleteBrowsingHistory(DWORD flags) { // in lieu of sending an IPC when it seems appropriate. Since we assume this // happens in one-off fashion, don't attempt to pack REMOVE_* arguments. // Instead, have the browser process clobber all history. + // + // IE8 on Vista launches us twice when the user asks to delete browsing data - + // once in low integrity and once in medium integrity. The low integrity + // instance will fail to connect to the automation server and restart it in an + // effort to connect. Thus, we detect if we are in that circumstance and exit + // silently. + base::IntegrityLevel integrity_level; + if (win_util::GetWinVersion() >= win_util::WINVERSION_VISTA && + !base::GetProcessIntegrityLevel(base::GetCurrentProcessHandle(), + &integrity_level)) { + return E_UNEXPECTED; + } + if (integrity_level == base::LOW_INTEGRITY) { + return S_OK; + } if (!InitializeAutomation(GetHostProcessName(false), L"", false, false, GURL(), GURL())) { return E_UNEXPECTED; |