| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 &temp_file_system_file_modification_time2_); | 196 &temp_file_system_file_modification_time2_); |
| 197 } | 197 } |
| 198 | 198 |
| 199 GURL GetFileSystemURL(const std::string& filename) { | 199 GURL GetFileSystemURL(const std::string& filename) { |
| 200 return GURL(file_system_root_url_.spec() + filename); | 200 return GURL(file_system_root_url_.spec() + filename); |
| 201 } | 201 } |
| 202 | 202 |
| 203 void WriteFileSystemFile(const std::string& filename, | 203 void WriteFileSystemFile(const std::string& filename, |
| 204 const char* buf, int buf_size, | 204 const char* buf, int buf_size, |
| 205 base::Time* modification_time) { | 205 base::Time* modification_time) { |
| 206 fileapi::FileSystemURL url(GURL(kFileSystemURLOrigin), | 206 fileapi::FileSystemURL url = |
| 207 kFileSystemType, | 207 file_system_context_->CreateCrackedFileSystemURL( |
| 208 FilePath().AppendASCII(filename)); | 208 GURL(kFileSystemURLOrigin), |
| 209 kFileSystemType, |
| 210 FilePath().AppendASCII(filename)); |
| 209 | 211 |
| 210 fileapi::FileSystemFileUtil* file_util = | 212 fileapi::FileSystemFileUtil* file_util = |
| 211 file_system_context_->GetFileUtil(kFileSystemType); | 213 file_system_context_->GetFileUtil(kFileSystemType); |
| 212 | 214 |
| 213 fileapi::FileSystemOperationContext context(file_system_context_); | 215 fileapi::FileSystemOperationContext context(file_system_context_); |
| 214 context.set_allowed_bytes_growth(1024); | 216 context.set_allowed_bytes_growth(1024); |
| 215 | 217 |
| 216 base::PlatformFile handle = base::kInvalidPlatformFileValue; | 218 base::PlatformFile handle = base::kInvalidPlatformFileValue; |
| 217 bool created = false; | 219 bool created = false; |
| 218 ASSERT_EQ(base::PLATFORM_FILE_OK, file_util->CreateOrOpen( | 220 ASSERT_EQ(base::PLATFORM_FILE_OK, file_util->CreateOrOpen( |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 EXPECT_TRUE(request_->response_headers()->GetMimeType(&content_type)); | 447 EXPECT_TRUE(request_->response_headers()->GetMimeType(&content_type)); |
| 446 EXPECT_EQ(kTestContentType, content_type); | 448 EXPECT_EQ(kTestContentType, content_type); |
| 447 void* iter = NULL; | 449 void* iter = NULL; |
| 448 std::string content_disposition; | 450 std::string content_disposition; |
| 449 EXPECT_TRUE(request_->response_headers()->EnumerateHeader( | 451 EXPECT_TRUE(request_->response_headers()->EnumerateHeader( |
| 450 &iter, "Content-Disposition", &content_disposition)); | 452 &iter, "Content-Disposition", &content_disposition)); |
| 451 EXPECT_EQ(kTestContentDisposition, content_disposition); | 453 EXPECT_EQ(kTestContentDisposition, content_disposition); |
| 452 } | 454 } |
| 453 | 455 |
| 454 } // namespace webkit_blob | 456 } // namespace webkit_blob |
| OLD | NEW |