| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_PUBLIC_TEST_MOCK_BLOB_URL_REQUEST_CONTEXT_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_MOCK_BLOB_URL_REQUEST_CONTEXT_H_ |
| 6 #define CONTENT_PUBLIC_TEST_MOCK_BLOB_URL_REQUEST_CONTEXT_H_ | 6 #define CONTENT_PUBLIC_TEST_MOCK_BLOB_URL_REQUEST_CONTEXT_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "net/url_request/url_request_context.h" | 9 #include "net/url_request/url_request_context.h" |
| 10 #include "net/url_request/url_request_job.h" | 10 #include "net/url_request/url_request_job.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 public: | 25 public: |
| 26 MockBlobURLRequestContext(storage::FileSystemContext* file_system_context); | 26 MockBlobURLRequestContext(storage::FileSystemContext* file_system_context); |
| 27 ~MockBlobURLRequestContext() override; | 27 ~MockBlobURLRequestContext() override; |
| 28 | 28 |
| 29 storage::BlobStorageContext* blob_storage_context() const { | 29 storage::BlobStorageContext* blob_storage_context() const { |
| 30 return blob_storage_context_.get(); | 30 return blob_storage_context_.get(); |
| 31 } | 31 } |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 net::URLRequestJobFactoryImpl job_factory_; | 34 net::URLRequestJobFactoryImpl job_factory_; |
| 35 scoped_ptr<storage::BlobStorageContext> blob_storage_context_; | 35 std::unique_ptr<storage::BlobStorageContext> blob_storage_context_; |
| 36 | 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(MockBlobURLRequestContext); | 37 DISALLOW_COPY_AND_ASSIGN(MockBlobURLRequestContext); |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 class ScopedTextBlob { | 40 class ScopedTextBlob { |
| 41 public: | 41 public: |
| 42 // Registers a blob with the given |id| that contains |data|. | 42 // Registers a blob with the given |id| that contains |data|. |
| 43 ScopedTextBlob(const MockBlobURLRequestContext& request_context, | 43 ScopedTextBlob(const MockBlobURLRequestContext& request_context, |
| 44 const std::string& blob_id, | 44 const std::string& blob_id, |
| 45 const std::string& data); | 45 const std::string& data); |
| 46 ~ScopedTextBlob(); | 46 ~ScopedTextBlob(); |
| 47 | 47 |
| 48 // Returns a BlobDataHandle referring to the scoped blob. | 48 // Returns a BlobDataHandle referring to the scoped blob. |
| 49 scoped_ptr<storage::BlobDataHandle> GetBlobDataHandle(); | 49 std::unique_ptr<storage::BlobDataHandle> GetBlobDataHandle(); |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 const std::string blob_id_; | 52 const std::string blob_id_; |
| 53 storage::BlobStorageContext* context_; | 53 storage::BlobStorageContext* context_; |
| 54 scoped_ptr<storage::BlobDataHandle> handle_; | 54 std::unique_ptr<storage::BlobDataHandle> handle_; |
| 55 | 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(ScopedTextBlob); | 56 DISALLOW_COPY_AND_ASSIGN(ScopedTextBlob); |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 } // namespace content | 59 } // namespace content |
| 60 | 60 |
| 61 #endif // CONTENT_PUBLIC_TEST_MOCK_BLOB_URL_REQUEST_CONTEXT_H_ | 61 #endif // CONTENT_PUBLIC_TEST_MOCK_BLOB_URL_REQUEST_CONTEXT_H_ |
| OLD | NEW |