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 "webkit/browser/appcache/appcache_response.h" | 5 #include "webkit/browser/appcache/appcache_response.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 int64 response_id, net::HttpResponseInfo* http_info, | 52 int64 response_id, net::HttpResponseInfo* http_info, |
53 int64 response_data_size) | 53 int64 response_data_size) |
54 : manifest_url_(manifest_url), response_id_(response_id), | 54 : manifest_url_(manifest_url), response_id_(response_id), |
55 http_response_info_(http_info), response_data_size_(response_data_size), | 55 http_response_info_(http_info), response_data_size_(response_data_size), |
56 service_(service) { | 56 service_(service) { |
57 DCHECK(http_info); | 57 DCHECK(http_info); |
58 DCHECK(response_id != kNoResponseId); | 58 DCHECK(response_id != kNoResponseId); |
59 service_->storage()->working_set()->AddResponseInfo(this); | 59 service_->storage()->working_set()->AddResponseInfo(this); |
60 } | 60 } |
61 | 61 |
| 62 AppCacheResponseInfo::AppCacheResponseInfo( |
| 63 const GURL& manifest_url, |
| 64 net::HttpResponseInfo* http_info, |
| 65 int64 response_data_size) |
| 66 : manifest_url_(manifest_url), |
| 67 response_id_(kSynthesizedResponseId), |
| 68 http_response_info_(http_info), |
| 69 response_data_size_(response_data_size), |
| 70 service_(NULL) { |
| 71 } |
| 72 |
62 AppCacheResponseInfo::~AppCacheResponseInfo() { | 73 AppCacheResponseInfo::~AppCacheResponseInfo() { |
63 service_->storage()->working_set()->RemoveResponseInfo(this); | 74 if (service_) |
| 75 service_->storage()->working_set()->RemoveResponseInfo(this); |
64 } | 76 } |
65 | 77 |
66 // HttpResponseInfoIOBuffer ------------------------------------------ | 78 // HttpResponseInfoIOBuffer ------------------------------------------ |
67 | 79 |
68 HttpResponseInfoIOBuffer::HttpResponseInfoIOBuffer() | 80 HttpResponseInfoIOBuffer::HttpResponseInfoIOBuffer() |
69 : response_data_size(kUnkownResponseDataSize) {} | 81 : response_data_size(kUnkownResponseDataSize) {} |
70 | 82 |
71 HttpResponseInfoIOBuffer::HttpResponseInfoIOBuffer(net::HttpResponseInfo* info) | 83 HttpResponseInfoIOBuffer::HttpResponseInfoIOBuffer(net::HttpResponseInfo* info) |
72 : http_info(info), response_data_size(kUnkownResponseDataSize) {} | 84 : http_info(info), response_data_size(kUnkownResponseDataSize) {} |
73 | 85 |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 create_callback_.Reset(); | 426 create_callback_.Reset(); |
415 } | 427 } |
416 | 428 |
417 if (info_buffer_.get()) | 429 if (info_buffer_.get()) |
418 ContinueWriteInfo(); | 430 ContinueWriteInfo(); |
419 else | 431 else |
420 ContinueWriteData(); | 432 ContinueWriteData(); |
421 } | 433 } |
422 | 434 |
423 } // namespace appcache | 435 } // namespace appcache |
OLD | NEW |