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

Side by Side Diff: chrome/browser/local_discovery/privet_url_fetcher.cc

Issue 177373010: [Privet FS] Allow files to be able to be copied in to the privet filesystem (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/local_discovery/privet_url_fetcher.h" 5 #include "chrome/browser/local_discovery/privet_url_fetcher.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 MakeRangeHeader(byte_range_start_, byte_range_end_)); 144 MakeRangeHeader(byte_range_start_, byte_range_end_));
145 } 145 }
146 146
147 if (make_response_file_) { 147 if (make_response_file_) {
148 url_fetcher_->SaveResponseToTemporaryFile( 148 url_fetcher_->SaveResponseToTemporaryFile(
149 content::BrowserThread::GetMessageLoopProxyForThread( 149 content::BrowserThread::GetMessageLoopProxyForThread(
150 content::BrowserThread::FILE)); 150 content::BrowserThread::FILE));
151 } 151 }
152 152
153 // URLFetcher requires us to set upload data for POST requests. 153 // URLFetcher requires us to set upload data for POST requests.
154 if (request_type_ == net::URLFetcher::POST) { 154 if (request_type_ == net::URLFetcher::POST ||
155 request_type_ == net::URLFetcher::PUT) {
155 if (!upload_file_path_.empty()) { 156 if (!upload_file_path_.empty()) {
156 url_fetcher_->SetUploadFilePath( 157 url_fetcher_->SetUploadFilePath(
157 upload_content_type_, 158 upload_content_type_,
158 upload_file_path_, 159 upload_file_path_,
159 0 /*offset*/, 160 0 /*offset*/,
160 kuint64max /*length*/, 161 kuint64max /*length*/,
161 content::BrowserThread::GetMessageLoopProxyForThread( 162 content::BrowserThread::GetMessageLoopProxyForThread(
162 content::BrowserThread::FILE)); 163 content::BrowserThread::FILE));
163 } else { 164 } else {
164 url_fetcher_->SetUploadData(upload_content_type_, upload_data_); 165 url_fetcher_->SetUploadData(upload_content_type_, upload_data_);
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 } 337 }
337 } 338 }
338 339
339 bool PrivetURLFetcher::PrivetErrorTransient(const std::string& error) { 340 bool PrivetURLFetcher::PrivetErrorTransient(const std::string& error) {
340 return (error == kPrivetErrorDeviceBusy) || 341 return (error == kPrivetErrorDeviceBusy) ||
341 (error == kPrivetErrorPendingUserAction) || 342 (error == kPrivetErrorPendingUserAction) ||
342 (error == kPrivetErrorPrinterBusy); 343 (error == kPrivetErrorPrinterBusy);
343 } 344 }
344 345
345 } // namespace local_discovery 346 } // namespace local_discovery
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698