| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "webkit/appcache/appcache_url_request_job.h" | 7 #include "webkit/appcache/appcache_url_request_job.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/command_line.h" |
| 11 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 12 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 13 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 14 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
| 15 #include "net/base/net_errors.h" | 16 #include "net/base/net_errors.h" |
| 16 #include "net/base/net_log.h" | 17 #include "net/base/net_log.h" |
| 17 #include "net/http/http_request_headers.h" | 18 #include "net/http/http_request_headers.h" |
| 18 #include "net/http/http_response_headers.h" | 19 #include "net/http/http_response_headers.h" |
| 19 #include "net/http/http_util.h" | 20 #include "net/http/http_util.h" |
| 20 #include "net/url_request/url_request.h" | 21 #include "net/url_request/url_request.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 case ERROR_DELIVERY: | 98 case ERROR_DELIVERY: |
| 98 AppCacheHistograms::AddErrorJobStartDelaySample( | 99 AppCacheHistograms::AddErrorJobStartDelaySample( |
| 99 base::TimeTicks::Now() - start_time_tick_); | 100 base::TimeTicks::Now() - start_time_tick_); |
| 100 request()->net_log().AddEvent( | 101 request()->net_log().AddEvent( |
| 101 net::NetLog::TYPE_APPCACHE_DELIVERING_ERROR_RESPONSE); | 102 net::NetLog::TYPE_APPCACHE_DELIVERING_ERROR_RESPONSE); |
| 102 NotifyStartError(net::URLRequestStatus(net::URLRequestStatus::FAILED, | 103 NotifyStartError(net::URLRequestStatus(net::URLRequestStatus::FAILED, |
| 103 net::ERR_FAILED)); | 104 net::ERR_FAILED)); |
| 104 break; | 105 break; |
| 105 | 106 |
| 106 case APPCACHED_DELIVERY: | 107 case APPCACHED_DELIVERY: |
| 108 if (entry_.IsExecutable() && |
| 109 CommandLine::ForCurrentProcess()->HasSwitch( |
| 110 kEnableExecutableHandlers)) { |
| 111 // TODO(michaeln): do something different here. |
| 112 } |
| 107 AppCacheHistograms::AddAppCacheJobStartDelaySample( | 113 AppCacheHistograms::AddAppCacheJobStartDelaySample( |
| 108 base::TimeTicks::Now() - start_time_tick_); | 114 base::TimeTicks::Now() - start_time_tick_); |
| 109 request()->net_log().AddEvent( | 115 request()->net_log().AddEvent( |
| 110 is_fallback_ ? | 116 is_fallback_ ? |
| 111 net::NetLog::TYPE_APPCACHE_DELIVERING_FALLBACK_RESPONSE : | 117 net::NetLog::TYPE_APPCACHE_DELIVERING_FALLBACK_RESPONSE : |
| 112 net::NetLog::TYPE_APPCACHE_DELIVERING_CACHED_RESPONSE); | 118 net::NetLog::TYPE_APPCACHE_DELIVERING_CACHED_RESPONSE); |
| 113 storage_->LoadResponseInfo( | 119 storage_->LoadResponseInfo( |
| 114 manifest_url_, group_id_, entry_.response_id(), this); | 120 manifest_url_, group_id_, entry_.response_id(), this); |
| 115 break; | 121 break; |
| 116 | 122 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 return; | 300 return; |
| 295 } | 301 } |
| 296 | 302 |
| 297 // If multiple ranges are requested, we play dumb and | 303 // If multiple ranges are requested, we play dumb and |
| 298 // return the entire response with 200 OK. | 304 // return the entire response with 200 OK. |
| 299 if (ranges.size() == 1U) | 305 if (ranges.size() == 1U) |
| 300 range_requested_ = ranges[0]; | 306 range_requested_ = ranges[0]; |
| 301 } | 307 } |
| 302 | 308 |
| 303 } // namespace appcache | 309 } // namespace appcache |
| OLD | NEW |