Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Unified Diff: webkit/appcache/appcache_host.cc

Issue 1600002: Indicate in the tab UI if appcache creation was blocked by privacy settings. (Closed)
Patch Set: updates Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/appcache/appcache_host.cc
diff --git a/webkit/appcache/appcache_host.cc b/webkit/appcache/appcache_host.cc
index 4fb098f259be5c91d8fda7ff971886f1c17f5aa8..13aa29e13a5319910b8560ed67bd070ff8df4408 100644
--- a/webkit/appcache/appcache_host.cc
+++ b/webkit/appcache/appcache_host.cc
@@ -16,7 +16,8 @@ AppCacheHost::AppCacheHost(int host_id, AppCacheFrontend* frontend,
pending_selected_cache_id_(kNoCacheId),
frontend_(frontend), service_(service),
pending_get_status_callback_(NULL), pending_start_update_callback_(NULL),
- pending_swap_cache_callback_(NULL), pending_callback_param_(NULL) {
+ pending_swap_cache_callback_(NULL), pending_callback_param_(NULL),
+ content_blocked_(false) {
}
AppCacheHost::~AppCacheHost() {
@@ -43,6 +44,9 @@ void AppCacheHost::SelectCache(const GURL& document_url,
!pending_swap_cache_callback_ &&
!pending_get_status_callback_);
+ if (content_blocked_)
+ frontend_->OnContentBlocked(host_id_);
+
// First we handle an unusual case of SelectCache being called a second
// time. Generally this shouldn't happen, but with bad content I think
// this can occur... <html manifest=foo> <html manifest=bar></html></html>
@@ -321,6 +325,10 @@ void AppCacheHost::OnUpdateComplete(AppCacheGroup* group) {
newest_cache_of_group_being_updated_ = NULL;
}
+void AppCacheHost::OnContentBlocked(AppCacheGroup* group) {
+ frontend_->OnContentBlocked(host_id_);
+}
+
void AppCacheHost::SetSwappableCache(AppCacheGroup* group) {
if (!group) {
swappable_cache_ = NULL;
@@ -343,6 +351,10 @@ void AppCacheHost::LoadMainResourceCache(int64 cache_id) {
service_->storage()->LoadCache(cache_id, this);
}
+void AppCacheHost::NotifyContentBlocked() {
+ content_blocked_ = true;
+}
+
void AppCacheHost::AssociateCache(AppCache* cache) {
if (associated_cache_.get()) {
associated_cache_->UnassociateHost(this);

Powered by Google App Engine
This is Rietveld 408576698