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 DCHECK(CommandLine::ForCurrentProcess()->HasSwitch( | |
110 kEnableExecutableHandlers)); | |
111 // TODO(michaeln): do something different here with | |
alecflett
2013/04/16 22:28:56
perhaps LOG() here? (not sure what the policy is a
michaeln
2013/04/16 22:43:02
should be short-lived that this is empty, afaict a
| |
112 // an AppCacheExecutableHandler. | |
113 } | |
107 AppCacheHistograms::AddAppCacheJobStartDelaySample( | 114 AppCacheHistograms::AddAppCacheJobStartDelaySample( |
108 base::TimeTicks::Now() - start_time_tick_); | 115 base::TimeTicks::Now() - start_time_tick_); |
109 request()->net_log().AddEvent( | 116 request()->net_log().AddEvent( |
110 is_fallback_ ? | 117 is_fallback_ ? |
111 net::NetLog::TYPE_APPCACHE_DELIVERING_FALLBACK_RESPONSE : | 118 net::NetLog::TYPE_APPCACHE_DELIVERING_FALLBACK_RESPONSE : |
112 net::NetLog::TYPE_APPCACHE_DELIVERING_CACHED_RESPONSE); | 119 net::NetLog::TYPE_APPCACHE_DELIVERING_CACHED_RESPONSE); |
113 storage_->LoadResponseInfo( | 120 storage_->LoadResponseInfo( |
114 manifest_url_, group_id_, entry_.response_id(), this); | 121 manifest_url_, group_id_, entry_.response_id(), this); |
115 break; | 122 break; |
116 | 123 |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
294 return; | 301 return; |
295 } | 302 } |
296 | 303 |
297 // If multiple ranges are requested, we play dumb and | 304 // If multiple ranges are requested, we play dumb and |
298 // return the entire response with 200 OK. | 305 // return the entire response with 200 OK. |
299 if (ranges.size() == 1U) | 306 if (ranges.size() == 1U) |
300 range_requested_ = ranges[0]; | 307 range_requested_ = ranges[0]; |
301 } | 308 } |
302 | 309 |
303 } // namespace appcache | 310 } // namespace appcache |
OLD | NEW |