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

Side by Side Diff: chrome/browser/safe_browsing/two_phase_uploader.cc

Issue 14578004: Support range uploading of a file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error on Win, Mac and Android. Created 7 years, 7 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
« no previous file with comments | « no previous file | net/url_request/test_url_fetcher_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/safe_browsing/two_phase_uploader.h" 5 #include "chrome/browser/safe_browsing/two_phase_uploader.h"
6 6
7 #include "base/basictypes.h"
7 #include "base/bind.h" 8 #include "base/bind.h"
8 #include "base/task_runner.h" 9 #include "base/task_runner.h"
9 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
10 #include "net/http/http_response_headers.h" 11 #include "net/http/http_response_headers.h"
11 #include "net/url_request/url_fetcher.h" 12 #include "net/url_request/url_fetcher.h"
12 #include "net/url_request/url_request_status.h" 13 #include "net/url_request/url_request_status.h"
13 14
14 namespace { 15 namespace {
15 16
16 // Header sent on initial request to start the two phase upload process. 17 // Header sent on initial request to start the two phase upload process.
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 128
128 void TwoPhaseUploader::UploadFile() { 129 void TwoPhaseUploader::UploadFile() {
129 DCHECK(CalledOnValidThread()); 130 DCHECK(CalledOnValidThread());
130 state_ = UPLOAD_FILE; 131 state_ = UPLOAD_FILE;
131 132
132 url_fetcher_.reset(net::URLFetcher::Create(upload_url_, net::URLFetcher::PUT, 133 url_fetcher_.reset(net::URLFetcher::Create(upload_url_, net::URLFetcher::PUT,
133 this)); 134 this));
134 url_fetcher_->SetRequestContext(url_request_context_getter_); 135 url_fetcher_->SetRequestContext(url_request_context_getter_);
135 url_fetcher_->SetUploadFilePath(kUploadContentType, 136 url_fetcher_->SetUploadFilePath(kUploadContentType,
136 file_path_, 137 file_path_,
138 0,
139 kuint64max,
137 file_task_runner_); 140 file_task_runner_);
138 url_fetcher_->Start(); 141 url_fetcher_->Start();
139 } 142 }
140 143
141 void TwoPhaseUploader::Finish(int net_error, 144 void TwoPhaseUploader::Finish(int net_error,
142 int response_code, 145 int response_code,
143 const std::string& response) { 146 const std::string& response) {
144 DCHECK(CalledOnValidThread()); 147 DCHECK(CalledOnValidThread());
145 finish_callback_.Run(state_, net_error, response_code, response); 148 finish_callback_.Run(state_, net_error, response_code, response);
146 } 149 }
OLDNEW
« no previous file with comments | « no previous file | net/url_request/test_url_fetcher_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698