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

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

Issue 508433002: Remove implicit conversions from scoped_refptr to T* in content/browser/service_worker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 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_url_request_job.h" 5 #include "content/browser/service_worker/service_worker_url_request_job.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request_); 257 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request_);
258 if (info) { 258 if (info) {
259 request->is_reload = PageTransitionCoreTypeIs(info->GetPageTransition(), 259 request->is_reload = PageTransitionCoreTypeIs(info->GetPageTransition(),
260 PAGE_TRANSITION_RELOAD); 260 PAGE_TRANSITION_RELOAD);
261 } 261 }
262 return request.Pass(); 262 return request.Pass();
263 } 263 }
264 264
265 bool ServiceWorkerURLRequestJob::CreateRequestBodyBlob(std::string* blob_uuid, 265 bool ServiceWorkerURLRequestJob::CreateRequestBodyBlob(std::string* blob_uuid,
266 uint64* blob_size) { 266 uint64* blob_size) {
267 if (!body_ || !blob_storage_context_) 267 if (!body_.get() || !blob_storage_context_)
268 return false; 268 return false;
269 const std::string uuid(base::GenerateGUID()); 269 const std::string uuid(base::GenerateGUID());
270 uint64 size = 0; 270 uint64 size = 0;
271 std::vector<const ResourceRequestBody::Element*> resolved_elements; 271 std::vector<const ResourceRequestBody::Element*> resolved_elements;
272 for (size_t i = 0; i < body_->elements()->size(); ++i) { 272 for (size_t i = 0; i < body_->elements()->size(); ++i) {
273 const ResourceRequestBody::Element& element = (*body_->elements())[i]; 273 const ResourceRequestBody::Element& element = (*body_->elements())[i];
274 if (element.type() != ResourceRequestBody::Element::TYPE_BLOB) { 274 if (element.type() != ResourceRequestBody::Element::TYPE_BLOB) {
275 resolved_elements.push_back(&element); 275 resolved_elements.push_back(&element);
276 continue; 276 continue;
277 } 277 }
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 void ServiceWorkerURLRequestJob::DeliverErrorResponse() { 405 void ServiceWorkerURLRequestJob::DeliverErrorResponse() {
406 // TODO(falken): Print an error to the console of the ServiceWorker and of 406 // TODO(falken): Print an error to the console of the ServiceWorker and of
407 // the requesting page. 407 // the requesting page.
408 CreateResponseHeader(500, 408 CreateResponseHeader(500,
409 "Service Worker Response Error", 409 "Service Worker Response Error",
410 std::map<std::string, std::string>()); 410 std::map<std::string, std::string>());
411 CommitResponseHeader(); 411 CommitResponseHeader();
412 } 412 }
413 413
414 } // namespace content 414 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698