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

Side by Side Diff: webkit/tools/test_shell/simple_resource_loader_bridge.cc

Issue 10832003: Add const accessors to URLRequest and UploadData. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Forgot to check browser_tests Created 8 years, 4 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
« no previous file with comments | « webkit/blob/blob_storage_controller.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This file contains an implementation of the ResourceLoaderBridge class. 5 // This file contains an implementation of the ResourceLoaderBridge class.
6 // The class is implemented using net::URLRequest, meaning it is a "simple" 6 // The class is implemented using net::URLRequest, meaning it is a "simple"
7 // version that directly issues requests. The more complicated one used in the 7 // version that directly issues requests. The more complicated one used in the
8 // browser uses IPC. 8 // browser uses IPC.
9 // 9 //
10 // Because net::URLRequest only provides an asynchronous resource loading API, 10 // Because net::URLRequest only provides an asynchronous resource loading API,
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 // If a redirect is received upload is cancelled in net::URLRequest, we 609 // If a redirect is received upload is cancelled in net::URLRequest, we
610 // should try to stop the |upload_progress_timer_| timer and return. 610 // should try to stop the |upload_progress_timer_| timer and return.
611 if (!request_->has_upload()) { 611 if (!request_->has_upload()) {
612 if (upload_progress_timer_.IsRunning()) 612 if (upload_progress_timer_.IsRunning())
613 upload_progress_timer_.Stop(); 613 upload_progress_timer_.Stop();
614 return; 614 return;
615 } 615 }
616 616
617 // GetContentLengthSync() may perform file IO, but it's ok here, as file 617 // GetContentLengthSync() may perform file IO, but it's ok here, as file
618 // IO is not prohibited in IOThread defined in the file. 618 // IO is not prohibited in IOThread defined in the file.
619 uint64 size = request_->get_upload()->GetContentLengthSync(); 619 uint64 size = request_->get_upload_mutable()->GetContentLengthSync();
620 uint64 position = request_->GetUploadProgress(); 620 uint64 position = request_->GetUploadProgress();
621 if (position == last_upload_position_) 621 if (position == last_upload_position_)
622 return; // no progress made since last time 622 return; // no progress made since last time
623 623
624 const uint64 kHalfPercentIncrements = 200; 624 const uint64 kHalfPercentIncrements = 200;
625 const base::TimeDelta kOneSecond = base::TimeDelta::FromMilliseconds(1000); 625 const base::TimeDelta kOneSecond = base::TimeDelta::FromMilliseconds(1000);
626 626
627 uint64 amt_since_last = position - last_upload_position_; 627 uint64 amt_since_last = position - last_upload_position_;
628 base::TimeDelta time_since_last = base::TimeTicks::Now() - 628 base::TimeDelta time_since_last = base::TimeTicks::Now() -
629 last_upload_ticks_; 629 last_upload_ticks_;
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
1130 (http_prefix.SchemeIs("http") || http_prefix.SchemeIs("https"))); 1130 (http_prefix.SchemeIs("http") || http_prefix.SchemeIs("https")));
1131 g_file_over_http_params = new FileOverHTTPParams(file_path_template, 1131 g_file_over_http_params = new FileOverHTTPParams(file_path_template,
1132 http_prefix); 1132 http_prefix);
1133 } 1133 }
1134 1134
1135 // static 1135 // static
1136 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create( 1136 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create(
1137 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { 1137 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) {
1138 return new ResourceLoaderBridgeImpl(request_info); 1138 return new ResourceLoaderBridgeImpl(request_info);
1139 } 1139 }
OLDNEW
« no previous file with comments | « webkit/blob/blob_storage_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698