summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/appcache_url_request_job.cc
diff options
context:
space:
mode:
authormichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-23 23:40:20 +0000
committermichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-23 23:40:20 +0000
commit07b8eedcd5cf8e9cc6c67f93a52d323d0638d46d (patch)
tree684e9a34c05debd6156ef945c5b60febd2b01de5 /webkit/appcache/appcache_url_request_job.cc
parent3f5d5837c8187216a92c5a2c4c171ceeccf54358 (diff)
downloadchromium_src-07b8eedcd5cf8e9cc6c67f93a52d323d0638d46d.zip
chromium_src-07b8eedcd5cf8e9cc6c67f93a52d323d0638d46d.tar.gz
chromium_src-07b8eedcd5cf8e9cc6c67f93a52d323d0638d46d.tar.bz2
Put minimal appcache info in the netlog.
BUG=49854 TEST=manual Review URL: http://codereview.chromium.org/2847068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53551 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_url_request_job.cc')
-rw-r--r--webkit/appcache/appcache_url_request_job.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/webkit/appcache/appcache_url_request_job.cc b/webkit/appcache/appcache_url_request_job.cc
index 05a5016..76a6663 100644
--- a/webkit/appcache/appcache_url_request_job.cc
+++ b/webkit/appcache/appcache_url_request_job.cc
@@ -9,8 +9,10 @@
#include "base/message_loop.h"
#include "base/string_util.h"
#include "net/base/net_errors.h"
+#include "net/base/net_log.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_util.h"
+#include "net/url_request/url_request.h"
#include "net/url_request/url_request_status.h"
namespace appcache {
@@ -21,6 +23,7 @@ AppCacheURLRequestJob::AppCacheURLRequestJob(
has_been_started_(false), has_been_killed_(false),
delivery_type_(AWAITING_DELIVERY_ORDERS),
cache_id_(kNoCacheId),
+ is_fallback_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(read_callback_(
this, &AppCacheURLRequestJob::OnReadComplete)) {
DCHECK(storage_);
@@ -32,13 +35,15 @@ AppCacheURLRequestJob::~AppCacheURLRequestJob() {
}
void AppCacheURLRequestJob::DeliverAppCachedResponse(
- const GURL& manifest_url, int64 cache_id, const AppCacheEntry& entry) {
+ const GURL& manifest_url, int64 cache_id, const AppCacheEntry& entry,
+ bool is_fallback) {
DCHECK(!has_delivery_orders());
DCHECK(entry.has_response_id());
delivery_type_ = APPCACHED_DELIVERY;
manifest_url_ = manifest_url;
cache_id_ = cache_id;
entry_ = entry;
+ is_fallback_ = is_fallback;
MaybeBeginDelivery();
}
@@ -81,11 +86,18 @@ void AppCacheURLRequestJob::BeginDelivery() {
break;
case ERROR_DELIVERY:
+ request()->net_log().AddEvent(
+ net::NetLog::TYPE_APPCACHE_DELIVERING_ERROR_RESPONSE, NULL);
NotifyStartError(
URLRequestStatus(URLRequestStatus::FAILED, net::ERR_FAILED));
break;
case APPCACHED_DELIVERY:
+ request()->net_log().AddEvent(
+ is_fallback_ ?
+ net::NetLog::TYPE_APPCACHE_DELIVERING_FALLBACK_RESPONSE :
+ net::NetLog::TYPE_APPCACHE_DELIVERING_CACHED_RESPONSE,
+ NULL);
storage_->LoadResponseInfo(manifest_url_, entry_.response_id(), this);
break;