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

Unified Diff: content/browser/webui/url_data_manager_backend.cc

Issue 2279293004: Fix DCHECK in debug build when navigating to an unknown chrome://theme/ URL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add dependency Created 4 years, 4 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
« no previous file with comments | « content/browser/webui/url_data_manager_backend.h ('k') | net/url_request/url_request_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/webui/url_data_manager_backend.cc
diff --git a/content/browser/webui/url_data_manager_backend.cc b/content/browser/webui/url_data_manager_backend.cc
index f600b409bbbb24c010dedae1412bfbd447282e33..09d5a24ff0af82146ce96ce79daf0dab47d1087b 100644
--- a/content/browser/webui/url_data_manager_backend.cc
+++ b/content/browser/webui/url_data_manager_backend.cc
@@ -399,20 +399,19 @@ void URLRequestChromeJob::DataAvailable(base::RefCountedMemory* bytes) {
TRACE_EVENT_ASYNC_END0("browser", "DataManager:Request", this);
DCHECK(!data_);
- // A passed-in nullptr signals an error.
- if (!bytes) {
- ReadRawDataComplete(net::ERR_FAILED);
- return;
- }
-
// All further requests will be satisfied from the passed-in data.
data_ = bytes;
if (pending_buf_) {
- int result = PostReadTask(pending_buf_, pending_buf_size_);
+ int result =
+ bytes ? PostReadTask(pending_buf_, pending_buf_size_) : net::ERR_FAILED;
pending_buf_ = nullptr;
if (result != net::ERR_IO_PENDING)
ReadRawDataComplete(result);
+ } else if (!bytes) {
+ // TODO(pkasting): This doesn't seem right, we want FAILED, not CANCELED.
+ // NotifyDone() could do that, but we can't access it.
+ NotifyCanceled();
mmenke 2016/08/27 12:56:52 For errors, this should be "OnRawReadComplete(net:
mmenke 2016/08/27 13:00:33 If the problem is that this class can't handle bei
Peter Kasting 2016/08/27 19:18:32 "OnRawReadComplete" isn't a string found in codese
mmenke 2016/08/27 20:21:25 Ah, I saw the addition of the "On return, |this| m
mmenke 2016/08/27 20:44:07 Alternatively, we could just remember the failure,
Peter Kasting 2016/08/27 22:03:51 There are no response headers, AFAIK. This isn't
mmenke 2016/08/27 22:28:05 Right, but URLRequest calls Start(), which must re
mmenke 2016/08/27 22:42:43 Also, note that there's no supported out-of-band w
Peter Kasting 2016/08/28 00:27:41 The critical call is URLDataSource::StartDataReque
}
}
« no previous file with comments | « content/browser/webui/url_data_manager_backend.h ('k') | net/url_request/url_request_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698