diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-30 14:36:09 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-30 14:36:09 +0000 |
commit | d84d00ee8720f26ffedc009f36fe4184c281f64d (patch) | |
tree | 1dafee29ff0092a629c2261f7465df2e5ba57ee6 /chrome/browser/first_run/first_run_win.cc | |
parent | 2359c08fb16eb3ac74b265067888b69ce6c4cbdb (diff) | |
download | chromium_src-d84d00ee8720f26ffedc009f36fe4184c281f64d.zip chromium_src-d84d00ee8720f26ffedc009f36fe4184c281f64d.tar.gz chromium_src-d84d00ee8720f26ffedc009f36fe4184c281f64d.tar.bz2 |
Fix some bad uses of GetTempDir.
(Just a first step. I can't remove GetTempDir yet though.)
BUG=none
TEST=unit tests
http://codereview.chromium.org/3075008/show
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54316 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/first_run/first_run_win.cc')
-rw-r--r-- | chrome/browser/first_run/first_run_win.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc index 9790558..ba1674f 100644 --- a/chrome/browser/first_run/first_run_win.cc +++ b/chrome/browser/first_run/first_run_win.cc @@ -155,11 +155,12 @@ bool WriteEULAtoTempFile(FilePath* eula_path) { ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_TERMS_HTML); if (terms.empty()) return false; - FilePath temp_dir; - if (!file_util::GetTempDir(&temp_dir)) + FILE *file = file_util::CreateAndOpenTemporaryFile(eula_path); + if (!file) return false; - *eula_path = temp_dir.Append(L"chrome_eula_iframe.html"); - return (file_util::WriteFile(*eula_path, terms.data(), terms.size()) > 0); + bool good = fwrite(terms.data(), terms.size(), 1, file) == 1; + fclose(file); + return good; } // Helper class that performs delayed first-run tasks that need more of the |