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

Side by Side Diff: content/browser/appcache/appcache_host.cc

Issue 2501343003: PlzNavigate: AppCache support. (Closed)
Patch Set: Add DCHECKs for PlzNavigate and fix a double Release problem which caused one unit_test to fail wit… Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/browser/appcache/appcache_host.h" 5 #include "content/browser/appcache/appcache_host.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "content/browser/appcache/appcache.h" 10 #include "content/browser/appcache/appcache.h"
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 const GURL& namespace_entry_url) { 520 const GURL& namespace_entry_url) {
521 main_resource_was_namespace_entry_ = true; 521 main_resource_was_namespace_entry_ = true;
522 namespace_entry_url_ = namespace_entry_url; 522 namespace_entry_url_ = namespace_entry_url;
523 } 523 }
524 524
525 void AppCacheHost::NotifyMainResourceBlocked(const GURL& manifest_url) { 525 void AppCacheHost::NotifyMainResourceBlocked(const GURL& manifest_url) {
526 main_resource_blocked_ = true; 526 main_resource_blocked_ = true;
527 blocked_manifest_url_ = manifest_url; 527 blocked_manifest_url_ = manifest_url;
528 } 528 }
529 529
530 void AppCacheHost::FrameNavigationCommitted(AppCacheFrontend* frontend,
531 AppCacheServiceImpl* service) {
532 DCHECK(frontend);
533 DCHECK(service);
534
535 frontend_ = frontend;
536 service_->RemoveObserver(this);
537 service_ = service;
538 service_->AddObserver(this);
539 }
540
530 void AppCacheHost::PrepareForTransfer() { 541 void AppCacheHost::PrepareForTransfer() {
531 // This can only happen prior to the document having been loaded. 542 // This can only happen prior to the document having been loaded.
532 DCHECK(!associated_cache()); 543 DCHECK(!associated_cache());
533 DCHECK(!is_selection_pending()); 544 DCHECK(!is_selection_pending());
534 DCHECK(!group_being_updated_.get()); 545 DCHECK(!group_being_updated_.get());
535 host_id_ = kAppCacheNoHostId; 546 host_id_ = kAppCacheNoHostId;
536 frontend_ = NULL; 547 frontend_ = NULL;
537 } 548 }
538 549
539 void AppCacheHost::CompleteTransfer(int host_id, AppCacheFrontend* frontend) { 550 void AppCacheHost::CompleteTransfer(int host_id, AppCacheFrontend* frontend) {
(...skipping 29 matching lines...) Expand all
569 associated_cache_info_pending_ = cache && !cache->is_complete(); 580 associated_cache_info_pending_ = cache && !cache->is_complete();
570 AppCacheInfo info; 581 AppCacheInfo info;
571 if (cache) 582 if (cache)
572 cache->AssociateHost(this); 583 cache->AssociateHost(this);
573 584
574 FillCacheInfo(cache, manifest_url, GetStatus(), &info); 585 FillCacheInfo(cache, manifest_url, GetStatus(), &info);
575 frontend_->OnCacheSelected(host_id_, info); 586 frontend_->OnCacheSelected(host_id_, info);
576 } 587 }
577 588
578 } // namespace content 589 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698