| 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 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_RESPONSE_H_ | 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_RESPONSE_H_ |
| 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_RESPONSE_H_ | 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_RESPONSE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> |
| 11 |
| 10 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 11 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 14 #include "content/common/appcache_interfaces.h" | 15 #include "content/common/appcache_interfaces.h" |
| 15 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
| 16 #include "net/base/completion_callback.h" | 17 #include "net/base/completion_callback.h" |
| 17 #include "net/http/http_response_info.h" | 18 #include "net/http/http_response_info.h" |
| 18 #include "url/gurl.h" | 19 #include "url/gurl.h" |
| 19 | 20 |
| 20 namespace net { | 21 namespace net { |
| 21 class IOBuffer; | 22 class IOBuffer; |
| 22 } | 23 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 45 return http_response_info_.get(); | 46 return http_response_info_.get(); |
| 46 } | 47 } |
| 47 int64_t response_data_size() const { return response_data_size_; } | 48 int64_t response_data_size() const { return response_data_size_; } |
| 48 | 49 |
| 49 private: | 50 private: |
| 50 friend class base::RefCounted<AppCacheResponseInfo>; | 51 friend class base::RefCounted<AppCacheResponseInfo>; |
| 51 virtual ~AppCacheResponseInfo(); | 52 virtual ~AppCacheResponseInfo(); |
| 52 | 53 |
| 53 const GURL manifest_url_; | 54 const GURL manifest_url_; |
| 54 const int64_t response_id_; | 55 const int64_t response_id_; |
| 55 const scoped_ptr<net::HttpResponseInfo> http_response_info_; | 56 const std::unique_ptr<net::HttpResponseInfo> http_response_info_; |
| 56 const int64_t response_data_size_; | 57 const int64_t response_data_size_; |
| 57 AppCacheStorage* storage_; | 58 AppCacheStorage* storage_; |
| 58 }; | 59 }; |
| 59 | 60 |
| 60 // A refcounted wrapper for HttpResponseInfo so we can apply the | 61 // A refcounted wrapper for HttpResponseInfo so we can apply the |
| 61 // refcounting semantics used with IOBuffer with these structures too. | 62 // refcounting semantics used with IOBuffer with these structures too. |
| 62 struct CONTENT_EXPORT HttpResponseInfoIOBuffer | 63 struct CONTENT_EXPORT HttpResponseInfoIOBuffer |
| 63 : public base::RefCountedThreadSafe<HttpResponseInfoIOBuffer> { | 64 : public base::RefCountedThreadSafe<HttpResponseInfoIOBuffer> { |
| 64 scoped_ptr<net::HttpResponseInfo> http_info; | 65 std::unique_ptr<net::HttpResponseInfo> http_info; |
| 65 int response_data_size; | 66 int response_data_size; |
| 66 | 67 |
| 67 HttpResponseInfoIOBuffer(); | 68 HttpResponseInfoIOBuffer(); |
| 68 explicit HttpResponseInfoIOBuffer(net::HttpResponseInfo* info); | 69 explicit HttpResponseInfoIOBuffer(net::HttpResponseInfo* info); |
| 69 | 70 |
| 70 protected: | 71 protected: |
| 71 friend class base::RefCountedThreadSafe<HttpResponseInfoIOBuffer>; | 72 friend class base::RefCountedThreadSafe<HttpResponseInfoIOBuffer>; |
| 72 virtual ~HttpResponseInfoIOBuffer(); | 73 virtual ~HttpResponseInfoIOBuffer(); |
| 73 }; | 74 }; |
| 74 | 75 |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 void OnIOComplete(int result) override; | 324 void OnIOComplete(int result) override; |
| 324 void OnOpenEntryComplete() override; | 325 void OnOpenEntryComplete() override; |
| 325 | 326 |
| 326 int write_amount_; | 327 int write_amount_; |
| 327 base::WeakPtrFactory<AppCacheResponseMetadataWriter> weak_factory_; | 328 base::WeakPtrFactory<AppCacheResponseMetadataWriter> weak_factory_; |
| 328 }; | 329 }; |
| 329 | 330 |
| 330 } // namespace content | 331 } // namespace content |
| 331 | 332 |
| 332 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_RESPONSE_H_ | 333 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_RESPONSE_H_ |
| OLD | NEW |