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

Unified Diff: base/file_util_posix.cc

Issue 600104: Actually delete databases in CookiesTreeModel. (Closed)
Patch Set: fixed comments Created 10 years, 10 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.h ('k') | base/file_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_posix.cc
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
index fe24259a148dd4e693e7b738c7f3cf11acf0c1c8..6e8735a957f3cc113f48df02cf3c20a121d30ff2 100644
--- a/base/file_util_posix.cc
+++ b/base/file_util_posix.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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.
@@ -14,6 +14,7 @@
#include <sys/errno.h>
#include <sys/mman.h>
#include <sys/stat.h>
+#include <sys/time.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>
@@ -458,6 +459,13 @@ bool GetFileInfo(const FilePath& file_path, FileInfo* results) {
return true;
}
+bool SetLastModifiedTime(const FilePath& file_path, base::Time last_modified) {
+ struct timeval times[2];
+ times[0] = last_modified.ToTimeVal();
+ times[1] = last_modified.ToTimeVal();
+ return (utimes(file_path.value().c_str(), times) == 0);
+}
+
bool GetInode(const FilePath& path, ino_t* inode) {
struct stat buffer;
int result = stat(path.value().c_str(), &buffer);
« no previous file with comments | « base/file_util.h ('k') | base/file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698