| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef SERVICES_URL_RESPONSE_DISK_CACHE_URL_RESPONSE_DISK_CACHE_IMPL_H_ | 5 #ifndef SERVICES_URL_RESPONSE_DISK_CACHE_URL_RESPONSE_DISK_CACHE_IMPL_H_ |
| 6 #define SERVICES_URL_RESPONSE_DISK_CACHE_URL_RESPONSE_DISK_CACHE_IMPL_H_ | 6 #define SERVICES_URL_RESPONSE_DISK_CACHE_URL_RESPONSE_DISK_CACHE_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 mojo::URLResponsePtr response, | 31 mojo::URLResponsePtr response, |
| 32 const GetExtractedContentCallback& callback) override; | 32 const GetExtractedContentCallback& callback) override; |
| 33 | 33 |
| 34 // As |GetFile|, but uses FilePath instead of mojo arrays. | 34 // As |GetFile|, but uses FilePath instead of mojo arrays. |
| 35 void GetFileInternal(mojo::URLResponsePtr response, | 35 void GetFileInternal(mojo::URLResponsePtr response, |
| 36 const FilePathPairCallback& callback); | 36 const FilePathPairCallback& callback); |
| 37 | 37 |
| 38 // Internal implementation of |GetExtractedContent|. The parameters are: | 38 // Internal implementation of |GetExtractedContent|. The parameters are: |
| 39 // |callback|: The callback to return values to the caller. It uses FilePath | 39 // |callback|: The callback to return values to the caller. It uses FilePath |
| 40 // instead of mojo arrays. | 40 // instead of mojo arrays. |
| 41 // |cache_dir|: The cache dir to return to the consumer. | 41 // |base_dir|: The base directory for caching data associated to the response. |
| 42 // |extracted_dir|: The directory where the file content must be extracted. It |
| 43 // will be returned to the consumer. |
| 42 // |content|: The content of the body of the response. | 44 // |content|: The content of the body of the response. |
| 43 // |dir|: The base directory under which all data for the response is stored. | 45 // |cache_dir|: The directory the user can user to cache its own content. |
| 44 void GetExtractedContentInternal(const FilePathPairCallback& callback, | 46 void GetExtractedContentInternal(const FilePathPairCallback& callback, |
| 45 const base::FilePath& cache_dir, | 47 const base::FilePath& base_dir, |
| 48 const base::FilePath& extracted_dir, |
| 46 const base::FilePath& content, | 49 const base::FilePath& content, |
| 47 const base::FilePath& dir); | 50 const base::FilePath& cache_dir); |
| 48 | 51 |
| 49 scoped_refptr<base::SequencedWorkerPool> worker_pool_; | 52 scoped_refptr<base::SequencedWorkerPool> worker_pool_; |
| 50 base::FilePath base_directory_; | 53 base::FilePath base_directory_; |
| 51 StrongBinding<URLResponseDiskCache> binding_; | 54 StrongBinding<URLResponseDiskCache> binding_; |
| 52 | 55 |
| 53 DISALLOW_COPY_AND_ASSIGN(URLResponseDiskCacheImpl); | 56 DISALLOW_COPY_AND_ASSIGN(URLResponseDiskCacheImpl); |
| 54 }; | 57 }; |
| 55 | 58 |
| 56 } // namespace mojo | 59 } // namespace mojo |
| 57 | 60 |
| 58 #endif // SERVICES_URL_RESPONSE_DISK_CACHE_URL_RESPONSE_DISK_CACHE_IMPL_H_ | 61 #endif // SERVICES_URL_RESPONSE_DISK_CACHE_URL_RESPONSE_DISK_CACHE_IMPL_H_ |
| OLD | NEW |