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

Unified Diff: extensions/browser/extension_protocols.cc

Issue 2771953003: Fix content verification code for undreadable and deleted files. (Closed)
Patch Set: . Created 3 years, 9 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: extensions/browser/extension_protocols.cc
diff --git a/extensions/browser/extension_protocols.cc b/extensions/browser/extension_protocols.cc
index 551064cbd784250c1073044c80fd3b3f5fb5c512..805a9f99b1f80af2bb207c339075d9e88c89cf5e 100644
--- a/extensions/browser/extension_protocols.cc
+++ b/extensions/browser/extension_protocols.cc
@@ -237,6 +237,17 @@ class URLRequestExtensionJob : public net::URLRequestFileJob {
URLRequestFileJob::SetExtraRequestHeaders(headers);
}
+ void OnOpenComplete(int result) override {
+ if (result < 0) {
+ // File open failure. |result| is net:: error code.
Devlin 2017/03/24 18:50:09 Let's expand on this a bit - something like: // Th
lazyboy 2017/03/24 19:22:55 Done. The empty case is crbug.com/703892, which is
+ if (verify_job_.get()) {
+ std::string tmp;
+ verify_job_->BytesRead(0, base::string_as_array(&tmp));
+ verify_job_->DoneReading();
+ }
+ }
+ }
+
void OnSeekComplete(int64_t result) override {
DCHECK_EQ(seek_position_, 0);
seek_position_ = result;

Powered by Google App Engine
This is Rietveld 408576698