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

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

Issue 13872022: Expose RequestComplete time to DRT (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 8 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 | « no previous file | 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 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 MaybeUpdateUploadProgress(); 637 MaybeUpdateUploadProgress();
638 upload_progress_timer_.Stop(); 638 upload_progress_timer_.Stop();
639 } 639 }
640 DCHECK(request_.get()); 640 DCHECK(request_.get());
641 // If |failed_file_request_status_| is not empty, which means the request 641 // If |failed_file_request_status_| is not empty, which means the request
642 // was a file request and encountered an error, then we need to use the 642 // was a file request and encountered an error, then we need to use the
643 // |failed_file_request_status_|. Otherwise use request_'s status. 643 // |failed_file_request_status_|. Otherwise use request_'s status.
644 OnCompletedRequest(failed_file_request_status_.get() ? 644 OnCompletedRequest(failed_file_request_status_.get() ?
645 failed_file_request_status_->error() : 645 failed_file_request_status_->error() :
646 request_->status().error(), 646 request_->status().error(),
647 std::string(), base::TimeTicks()); 647 std::string(), base::TimeTicks::Now());
648 request_.reset(); // destroy on the io thread 648 request_.reset(); // destroy on the io thread
649 } 649 }
650 650
651 // Called on the IO thread. 651 // Called on the IO thread.
652 void MaybeUpdateUploadProgress() { 652 void MaybeUpdateUploadProgress() {
653 // If a redirect is received upload is cancelled in net::URLRequest, we 653 // If a redirect is received upload is cancelled in net::URLRequest, we
654 // should try to stop the |upload_progress_timer_| timer and return. 654 // should try to stop the |upload_progress_timer_| timer and return.
655 if (!request_->has_upload()) { 655 if (!request_->has_upload()) {
656 if (upload_progress_timer_.IsRunning()) 656 if (upload_progress_timer_.IsRunning())
657 upload_progress_timer_.Stop(); 657 upload_progress_timer_.Stop();
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 if (!g_file_over_http_mappings) 1157 if (!g_file_over_http_mappings)
1158 g_file_over_http_mappings = new FileOverHTTPPathMappings(); 1158 g_file_over_http_mappings = new FileOverHTTPPathMappings();
1159 g_file_over_http_mappings->AddMapping(file_path_template, http_prefix); 1159 g_file_over_http_mappings->AddMapping(file_path_template, http_prefix);
1160 } 1160 }
1161 1161
1162 // static 1162 // static
1163 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create( 1163 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create(
1164 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { 1164 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) {
1165 return new ResourceLoaderBridgeImpl(request_info); 1165 return new ResourceLoaderBridgeImpl(request_info);
1166 } 1166 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698