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

Side by Side Diff: mojo/services/network/url_loader_impl.cc

Issue 1227373002: Roll mojo SDK to 734c6e1652ff2f3b696e441722838f453f4f9b42 (Closed) Base URL: https://github.com/domokit/monet.git@master
Patch Set: Created 5 years, 5 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 "mojo/services/network/url_loader_impl.h" 5 #include "mojo/services/network/url_loader_impl.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 } 529 }
530 if (request->body) { 530 if (request->body) {
531 ScopedVector<net::UploadElementReader> element_readers; 531 ScopedVector<net::UploadElementReader> element_readers;
532 for (size_t i = 0; i < request->body.size(); ++i) { 532 for (size_t i = 0; i < request->body.size(); ++i) {
533 element_readers.push_back( 533 element_readers.push_back(
534 new UploadDataPipeElementReader(request->body[i].Pass())); 534 new UploadDataPipeElementReader(request->body[i].Pass()));
535 } 535 }
536 url_request_->set_upload(make_scoped_ptr<net::UploadDataStream>( 536 url_request_->set_upload(make_scoped_ptr<net::UploadDataStream>(
537 new net::ElementsUploadDataStream(element_readers.Pass(), 0))); 537 new net::ElementsUploadDataStream(element_readers.Pass(), 0)));
538 } 538 }
539 int load_flags = 0;
539 if (request->bypass_cache) 540 if (request->bypass_cache)
540 url_request_->SetLoadFlags(net::LOAD_BYPASS_CACHE); 541 load_flags |= net::LOAD_BYPASS_CACHE;
542 if (request->only_from_cache)
543 load_flags |= net::LOAD_ONLY_FROM_CACHE;
544 if (load_flags)
545 url_request_->SetLoadFlags(load_flags);
541 546
542 response_body_buffer_size_ = request->response_body_buffer_size; 547 response_body_buffer_size_ = request->response_body_buffer_size;
543 auto_follow_redirects_ = request->auto_follow_redirects; 548 auto_follow_redirects_ = request->auto_follow_redirects;
544 549
545 url_request_->Start(); 550 url_request_->Start();
546 } 551 }
547 552
548 void URLLoaderImpl::SendResponse(URLResponsePtr response) { 553 void URLLoaderImpl::SendResponse(URLResponsePtr response) {
549 if (interceptor_index_ >= 0 && 554 if (interceptor_index_ >= 0 &&
550 interceptor_index_ < static_cast<int>(interceptors_.size())) { 555 interceptor_index_ < static_cast<int>(interceptors_.size())) {
(...skipping 20 matching lines...) Expand all
571 if ((*it)->id() == current_fetcher_id_) { 576 if ((*it)->id() == current_fetcher_id_) {
572 last_status_ = fetcher->QueryStatus(); 577 last_status_ = fetcher->QueryStatus();
573 last_status_->is_loading = false; 578 last_status_->is_loading = false;
574 } 579 }
575 body_fetchers_.erase(it); 580 body_fetchers_.erase(it);
576 if (body_fetchers_.empty() and !binding_.is_bound()) 581 if (body_fetchers_.empty() and !binding_.is_bound())
577 delete this; 582 delete this;
578 } 583 }
579 584
580 } // namespace mojo 585 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698