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

Side by Side Diff: content/browser/service_worker/service_worker_cache.cc

Issue 667943003: Standardize usage of virtual/override/final in content/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/service_worker/service_worker_cache.h" 5 #include "content/browser/service_worker/service_worker_cache.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/guid.h" 10 #include "base/guid.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 void StreamBlobToCache(net::URLRequestContext* request_context, 106 void StreamBlobToCache(net::URLRequestContext* request_context,
107 scoped_ptr<storage::BlobDataHandle> blob_data_handle, 107 scoped_ptr<storage::BlobDataHandle> blob_data_handle,
108 const BoolCallback& callback) { 108 const BoolCallback& callback) {
109 callback_ = callback; 109 callback_ = callback;
110 blob_request_ = storage::BlobProtocolHandler::CreateBlobRequest( 110 blob_request_ = storage::BlobProtocolHandler::CreateBlobRequest(
111 blob_data_handle.Pass(), request_context, this); 111 blob_data_handle.Pass(), request_context, this);
112 blob_request_->Start(); 112 blob_request_->Start();
113 } 113 }
114 114
115 // net::URLRequest::Delegate overrides for reading blobs. 115 // net::URLRequest::Delegate overrides for reading blobs.
116 virtual void OnReceivedRedirect(net::URLRequest* request, 116 void OnReceivedRedirect(net::URLRequest* request,
117 const net::RedirectInfo& redirect_info, 117 const net::RedirectInfo& redirect_info,
118 bool* defer_redirect) override { 118 bool* defer_redirect) override {
119 NOTREACHED(); 119 NOTREACHED();
120 } 120 }
121 virtual void OnAuthRequired(net::URLRequest* request, 121 void OnAuthRequired(net::URLRequest* request,
122 net::AuthChallengeInfo* auth_info) override { 122 net::AuthChallengeInfo* auth_info) override {
123 NOTREACHED(); 123 NOTREACHED();
124 } 124 }
125 virtual void OnCertificateRequested( 125 void OnCertificateRequested(
126 net::URLRequest* request, 126 net::URLRequest* request,
127 net::SSLCertRequestInfo* cert_request_info) override { 127 net::SSLCertRequestInfo* cert_request_info) override {
128 NOTREACHED(); 128 NOTREACHED();
129 } 129 }
130 virtual void OnSSLCertificateError(net::URLRequest* request, 130 void OnSSLCertificateError(net::URLRequest* request,
131 const net::SSLInfo& ssl_info, 131 const net::SSLInfo& ssl_info,
132 bool fatal) override { 132 bool fatal) override {
133 NOTREACHED(); 133 NOTREACHED();
134 } 134 }
135 virtual void OnBeforeNetworkStart(net::URLRequest* request, 135 void OnBeforeNetworkStart(net::URLRequest* request, bool* defer) override {
136 bool* defer) override {
137 NOTREACHED(); 136 NOTREACHED();
138 } 137 }
139 138
140 virtual void OnResponseStarted(net::URLRequest* request) override { 139 void OnResponseStarted(net::URLRequest* request) override {
141 if (!request->status().is_success()) { 140 if (!request->status().is_success()) {
142 callback_.Run(false); 141 callback_.Run(false);
143 return; 142 return;
144 } 143 }
145 ReadFromBlob(); 144 ReadFromBlob();
146 } 145 }
147 146
148 virtual void ReadFromBlob() { 147 virtual void ReadFromBlob() {
149 int bytes_read = 0; 148 int bytes_read = 0;
150 bool done = 149 bool done =
151 blob_request_->Read(buffer_.get(), buffer_->size(), &bytes_read); 150 blob_request_->Read(buffer_.get(), buffer_->size(), &bytes_read);
152 if (done) 151 if (done)
153 OnReadCompleted(blob_request_.get(), bytes_read); 152 OnReadCompleted(blob_request_.get(), bytes_read);
154 } 153 }
155 154
156 virtual void OnReadCompleted(net::URLRequest* request, 155 void OnReadCompleted(net::URLRequest* request, int bytes_read) override {
157 int bytes_read) override {
158 if (!request->status().is_success()) { 156 if (!request->status().is_success()) {
159 callback_.Run(false); 157 callback_.Run(false);
160 return; 158 return;
161 } 159 }
162 160
163 if (bytes_read == 0) { 161 if (bytes_read == 0) {
164 callback_.Run(true); 162 callback_.Run(true);
165 return; 163 return;
166 } 164 }
167 165
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 initialized_ = true; 1097 initialized_ = true;
1100 for (std::vector<base::Closure>::iterator it = init_callbacks_.begin(); 1098 for (std::vector<base::Closure>::iterator it = init_callbacks_.begin();
1101 it != init_callbacks_.end(); 1099 it != init_callbacks_.end();
1102 ++it) { 1100 ++it) {
1103 it->Run(); 1101 it->Run();
1104 } 1102 }
1105 init_callbacks_.clear(); 1103 init_callbacks_.clear();
1106 } 1104 }
1107 1105
1108 } // namespace content 1106 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698