| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 3413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3424 ShareableFileReference::GetOrCreate( | 3424 ShareableFileReference::GetOrCreate( |
| 3425 file_path, ShareableFileReference::DELETE_ON_FINAL_RELEASE, | 3425 file_path, ShareableFileReference::DELETE_ON_FINAL_RELEASE, |
| 3426 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE).get()); | 3426 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE).get()); |
| 3427 | 3427 |
| 3428 // Not readable. | 3428 // Not readable. |
| 3429 EXPECT_FALSE(ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( | 3429 EXPECT_FALSE(ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( |
| 3430 filter_->child_id(), file_path)); | 3430 filter_->child_id(), file_path)); |
| 3431 | 3431 |
| 3432 // Register it for a resource request. | 3432 // Register it for a resource request. |
| 3433 auto downloaded_file = | 3433 auto downloaded_file = |
| 3434 DownloadedTempFileImpl::CreateForTesting(filter_->child_id(), kRequestID); | 3434 DownloadedTempFileImpl::Create(filter_->child_id(), kRequestID); |
| 3435 mojom::DownloadedTempFilePtr downloaded_file_ptr = | 3435 mojom::DownloadedTempFilePtr downloaded_file_ptr = |
| 3436 DownloadedTempFileImpl::CreateForTesting(filter_->child_id(), kRequestID); | 3436 DownloadedTempFileImpl::Create(filter_->child_id(), kRequestID); |
| 3437 host_.RegisterDownloadedTempFile(filter_->child_id(), kRequestID, file_path); | 3437 host_.RegisterDownloadedTempFile(filter_->child_id(), kRequestID, file_path); |
| 3438 | 3438 |
| 3439 // Should be readable now. | 3439 // Should be readable now. |
| 3440 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( | 3440 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( |
| 3441 filter_->child_id(), file_path)); | 3441 filter_->child_id(), file_path)); |
| 3442 | 3442 |
| 3443 // The child releases from the request. | 3443 // The child releases from the request. |
| 3444 downloaded_file_ptr = nullptr; | 3444 downloaded_file_ptr = nullptr; |
| 3445 base::RunLoop().RunUntilIdle(); | 3445 base::RunLoop().RunUntilIdle(); |
| 3446 | 3446 |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3994 return nullptr; | 3994 return nullptr; |
| 3995 } | 3995 } |
| 3996 | 3996 |
| 3997 INSTANTIATE_TEST_CASE_P( | 3997 INSTANTIATE_TEST_CASE_P( |
| 3998 ResourceDispatcherHostTests, | 3998 ResourceDispatcherHostTests, |
| 3999 ResourceDispatcherHostTest, | 3999 ResourceDispatcherHostTest, |
| 4000 testing::Values(TestConfig::kDefault, | 4000 testing::Values(TestConfig::kDefault, |
| 4001 TestConfig::kOptimizeIPCForSmallResourceEnabled)); | 4001 TestConfig::kOptimizeIPCForSmallResourceEnabled)); |
| 4002 | 4002 |
| 4003 } // namespace content | 4003 } // namespace content |
| OLD | NEW |