Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2487)

Unified Diff: chrome/browser/extensions/convert_user_script.cc

Issue 6297003: Fail gracefully if profile Temp dir can not be accessed. (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: Address rev comments. Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/file_util_win.cc ('k') | chrome/browser/extensions/convert_web_app.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/convert_user_script.cc
diff --git a/chrome/browser/extensions/convert_user_script.cc b/chrome/browser/extensions/convert_user_script.cc
index 7322c707121b3b343e80c88c9a3210fba52fc41d..0b45da876f182d0c849fce2a9e11daf580234495 100644
--- a/chrome/browser/extensions/convert_user_script.cc
+++ b/chrome/browser/extensions/convert_user_script.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -18,6 +18,7 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
+#include "chrome/common/extensions/extension_file_util.h"
#include "chrome/common/extensions/user_script.h"
#include "chrome/common/json_value_serializer.h"
#include "googleurl/src/gurl.h"
@@ -45,8 +46,11 @@ scoped_refptr<Extension> ConvertUserScriptToExtension(
return NULL;
}
- FilePath user_data_temp_dir;
- CHECK(PathService::Get(chrome::DIR_USER_DATA_TEMP, &user_data_temp_dir));
+ FilePath user_data_temp_dir = extension_file_util::GetUserDataTempDir();
+ if (user_data_temp_dir.empty()) {
+ *error = "Could not get path to profile temporary directory.";
+ return NULL;
+ }
ScopedTempDir temp_dir;
if (!temp_dir.CreateUniqueTempDirUnderPath(user_data_temp_dir)) {
« no previous file with comments | « base/file_util_win.cc ('k') | chrome/browser/extensions/convert_web_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698