Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 WEBKIT_BLOB_BLOB_URL_REQUEST_JOB_FACTORY_H_ | 5 #ifndef WEBKIT_BLOB_BLOB_URL_REQUEST_JOB_FACTORY_H_ |
| 6 #define WEBKIT_BLOB_BLOB_URL_REQUEST_JOB_FACTORY_H_ | 6 #define WEBKIT_BLOB_BLOB_URL_REQUEST_JOB_FACTORY_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "net/url_request/url_request_job_factory.h" | 10 #include "net/url_request/url_request_job_factory.h" |
| 11 #include "webkit/storage/webkit_storage_export.h" | 11 #include "webkit/storage/webkit_storage_export.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 class MessageLoopProxy; | 14 class MessageLoopProxy; |
| 15 } // namespace base | 15 } // namespace base |
| 16 | 16 |
| 17 namespace fileapi { | |
| 18 class FileSystemContext; | |
| 19 } // namespace fileapi | |
| 20 | |
| 17 namespace net { | 21 namespace net { |
| 18 class URLRequest; | 22 class URLRequest; |
| 19 } // namespace net | 23 } // namespace net |
| 20 | 24 |
| 21 namespace webkit_blob { | 25 namespace webkit_blob { |
| 22 | 26 |
| 23 class BlobData; | 27 class BlobData; |
| 24 class BlobStorageController; | 28 class BlobStorageController; |
| 25 | 29 |
| 26 class WEBKIT_STORAGE_EXPORT BlobProtocolHandler | 30 class WEBKIT_STORAGE_EXPORT BlobProtocolHandler |
| 27 : public net::URLRequestJobFactory::ProtocolHandler { | 31 : public net::URLRequestJobFactory::ProtocolHandler { |
| 28 public: | 32 public: |
| 29 // |controller|'s lifetime should exceed the lifetime of the ProtocolHandler. | 33 // |controller|'s lifetime should exceed the lifetime of the ProtocolHandler. |
| 30 explicit BlobProtocolHandler( | 34 explicit BlobProtocolHandler( |
|
kinuko
2012/10/19 11:18:36
looks like we can drop this explicit now (not dire
hashimoto
2012/10/19 14:59:07
Good catch,
Done.
| |
| 31 BlobStorageController* blob_storage_controller, | 35 BlobStorageController* blob_storage_controller, |
| 36 fileapi::FileSystemContext* file_system_context, | |
| 32 base::MessageLoopProxy* file_loop_proxy); | 37 base::MessageLoopProxy* file_loop_proxy); |
| 33 virtual ~BlobProtocolHandler(); | 38 virtual ~BlobProtocolHandler(); |
| 34 | 39 |
| 35 virtual net::URLRequestJob* MaybeCreateJob( | 40 virtual net::URLRequestJob* MaybeCreateJob( |
| 36 net::URLRequest* request, | 41 net::URLRequest* request, |
| 37 net::NetworkDelegate* network_delegate) const OVERRIDE; | 42 net::NetworkDelegate* network_delegate) const OVERRIDE; |
| 38 | 43 |
| 39 private: | 44 private: |
| 40 virtual scoped_refptr<BlobData> LookupBlobData( | 45 virtual scoped_refptr<BlobData> LookupBlobData( |
| 41 net::URLRequest* request) const; | 46 net::URLRequest* request) const; |
| 42 | 47 |
| 43 // No scoped_refptr because |blob_storage_controller_| is owned by the | 48 // No scoped_refptr because |blob_storage_controller_| is owned by the |
| 44 // ProfileIOData, which also owns this ProtocolHandler. | 49 // ProfileIOData, which also owns this ProtocolHandler. |
| 45 BlobStorageController* const blob_storage_controller_; | 50 BlobStorageController* const blob_storage_controller_; |
| 51 const scoped_refptr<fileapi::FileSystemContext> file_system_context_; | |
| 46 const scoped_refptr<base::MessageLoopProxy> file_loop_proxy_; | 52 const scoped_refptr<base::MessageLoopProxy> file_loop_proxy_; |
| 47 | 53 |
| 48 DISALLOW_COPY_AND_ASSIGN(BlobProtocolHandler); | 54 DISALLOW_COPY_AND_ASSIGN(BlobProtocolHandler); |
| 49 }; | 55 }; |
| 50 | 56 |
| 51 } // namespace webkit_blob | 57 } // namespace webkit_blob |
| 52 | 58 |
| 53 #endif // WEBKIT_BLOB_BLOB_URL_REQUEST_JOB_FACTORY_H_ | 59 #endif // WEBKIT_BLOB_BLOB_URL_REQUEST_JOB_FACTORY_H_ |
| OLD | NEW |