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

Unified Diff: webkit/support/webkit_support.cc

Issue 7034047: Exporting ScopedTempDir so it can be used by webkit layout tests. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix for win build and chrome refactoring Created 9 years, 7 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 | « webkit/support/webkit_support.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/support/webkit_support.cc
diff --git a/webkit/support/webkit_support.cc b/webkit/support/webkit_support.cc
index ae6f08a8df1f6006b86ca184c348b34632342b45..6b40477d4a0fe01fc1ed4159c48012c3f6d21b1a 100644
--- a/webkit/support/webkit_support.cc
+++ b/webkit/support/webkit_support.cc
@@ -17,6 +17,7 @@
#include "base/message_loop.h"
#include "base/path_service.h"
#include "base/process_util.h"
+#include "base/scoped_temp_dir.h"
#include "base/string_piece.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
@@ -486,6 +487,26 @@ WebURL LocalFileToDataURL(const WebURL& fileUrl) {
return WebURL(GURL(kDataUrlPrefix + contents_base64));
}
+// A wrapper object for exporting ScopedTempDir to be used
+// by webkit layout tests.
+class ScopedTempDirectoryInternal : public ScopedTempDirectory {
+ public:
+ virtual bool CreateUniqueTempDir() {
+ return tempDirectory_.CreateUniqueTempDir();
+ }
+
+ virtual std::string path() const {
+ return tempDirectory_.path().MaybeAsASCII();
darin (slow to review) 2011/05/23 16:29:56 this probably isn't a big deal for developers, but
+ }
+
+ private:
+ ScopedTempDir tempDirectory_;
+};
+
+ScopedTempDirectory* CreateScopedTempDirectory() {
+ return new ScopedTempDirectoryInternal();
+}
+
int64 GetCurrentTimeInMillisecond() {
return base::TimeTicks::Now().ToInternalValue()
/ base::Time::kMicrosecondsPerMillisecond;
« no previous file with comments | « webkit/support/webkit_support.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698