summaryrefslogtreecommitdiffstats
path: root/o3d
diff options
context:
space:
mode:
authorgspencer@google.com <gspencer@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-16 21:41:57 +0000
committergspencer@google.com <gspencer@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-16 21:41:57 +0000
commita1748e45f0b50f59ea37ce9d065b0bcfb47c8e91 (patch)
tree87b496a110b306feda4d0a28f823f35be2c9474a /o3d
parentc84a78578ea53490282bfb128fd844b120f926b5 (diff)
downloadchromium_src-a1748e45f0b50f59ea37ce9d065b0bcfb47c8e91.zip
chromium_src-a1748e45f0b50f59ea37ce9d065b0bcfb47c8e91.tar.gz
chromium_src-a1748e45f0b50f59ea37ce9d065b0bcfb47c8e91.tar.bz2
Reverts fix for the scons build and fixes it in a different way so
that both the scons and gyp builds are functional. Review URL: http://codereview.chromium.org/204049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26399 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r--o3d/utils/cross/temporary_file.cc8
-rw-r--r--o3d/utils/cross/temporary_file_test.cc15
2 files changed, 18 insertions, 5 deletions
diff --git a/o3d/utils/cross/temporary_file.cc b/o3d/utils/cross/temporary_file.cc
index afb4b61..fb9e8de 100644
--- a/o3d/utils/cross/temporary_file.cc
+++ b/o3d/utils/cross/temporary_file.cc
@@ -39,6 +39,12 @@
namespace o3d {
+// TODO(gspencer): Remove this. This is a hack to prevent needing to
+// merge all of chrome's base code into the google code O3D tree.
+#ifndef GYP_BUILD
+#define CreateTemporaryFile CreateTemporaryFileName
+#endif
+
namespace {
void DeletePath(const FilePath& path) {
if (!path.empty()) {
@@ -57,7 +63,7 @@ TemporaryFile::TemporaryFile(const FilePath& file_to_manage)
bool TemporaryFile::Create(TemporaryFile* temporary_file) {
FilePath temporary_path;
- if (file_util::CreateTemporaryFileName(&temporary_path)) {
+ if (file_util::CreateTemporaryFile(&temporary_path)) {
temporary_file->Reset(temporary_path);
} else {
return false;
diff --git a/o3d/utils/cross/temporary_file_test.cc b/o3d/utils/cross/temporary_file_test.cc
index bdbe492..d9ae361 100644
--- a/o3d/utils/cross/temporary_file_test.cc
+++ b/o3d/utils/cross/temporary_file_test.cc
@@ -40,6 +40,13 @@
namespace o3d {
+// TODO(gspencer): Remove this once scons build is dead. This is a
+// hack to prevent needing to merge all of chrome's base code into the
+// google code O3D tree.
+#ifndef GYP_BUILD
+#define CreateTemporaryFile CreateTemporaryFileName
+#endif
+
class TemporaryFileTest : public testing::Test {
};
@@ -50,7 +57,7 @@ TEST_F(TemporaryFileTest, BasicConstruction) {
TEST_F(TemporaryFileTest, BasicFunction) {
FilePath path;
- file_util::CreateTemporaryFileName(&path);
+ file_util::CreateTemporaryFile(&path);
EXPECT_TRUE(file_util::PathExists(path));
{
TemporaryFile temporary_file(path);
@@ -64,8 +71,8 @@ TEST_F(TemporaryFileTest, BasicFunction) {
TEST_F(TemporaryFileTest, Reset) {
FilePath path;
FilePath path1;
- file_util::CreateTemporaryFileName(&path);
- file_util::CreateTemporaryFileName(&path1);
+ file_util::CreateTemporaryFile(&path);
+ file_util::CreateTemporaryFile(&path1);
EXPECT_TRUE(file_util::PathExists(path));
EXPECT_TRUE(file_util::PathExists(path1));
{
@@ -86,7 +93,7 @@ TEST_F(TemporaryFileTest, Reset) {
TEST_F(TemporaryFileTest, Release) {
FilePath path;
- file_util::CreateTemporaryFileName(&path);
+ file_util::CreateTemporaryFile(&path);
EXPECT_TRUE(file_util::PathExists(path));
{
TemporaryFile temporary_file(path);