Chromium Code Reviews| 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; |