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

Unified Diff: content/browser/loader/resource_loader.cc

Issue 2335133003: PlzNavigate: support the WebRequest API (Closed)
Patch Set: Added missing comment Created 4 years, 3 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: content/browser/loader/resource_loader.cc
diff --git a/content/browser/loader/resource_loader.cc b/content/browser/loader/resource_loader.cc
index 586f22247aeb33c99972112a74ff720050f10930..3bf5d204ee4b333c3cdfc0e84195218e2c9cf3e5 100644
--- a/content/browser/loader/resource_loader.cc
+++ b/content/browser/loader/resource_loader.cc
@@ -482,10 +482,14 @@ void ResourceLoader::StartRequestInternal() {
return;
}
+ base::WeakPtr<ResourceLoader> weak_self = weak_ptr_factory_.GetWeakPtr();
started_request_ = true;
request_->Start();
- delegate_->DidStartRequest(this);
+ // Starting the request may have lead to the deletion of this ResourceLoader
+ // if an error occured when calling NetworkDelegate::NotifyBeforeURLRequest.
+ if (weak_self.get())
nasko 2016/09/22 18:32:50 This seems like a generic issue unrelated to the g
clamy 2016/09/26 15:37:51 Done.
+ delegate_->DidStartRequest(this);
}
void ResourceLoader::CancelRequestInternal(int error, bool from_renderer) {

Powered by Google App Engine
This is Rietveld 408576698