OLD | NEW |
---|---|
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 #include "content/browser/loader/resource_loader.h" | 5 #include "content/browser/loader/resource_loader.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
153 handler_->OnUploadProgress( | 153 handler_->OnUploadProgress( |
154 info->GetRequestID(), progress.position(), progress.size()); | 154 info->GetRequestID(), progress.position(), progress.size()); |
155 waiting_for_upload_progress_ack_ = true; | 155 waiting_for_upload_progress_ack_ = true; |
156 } | 156 } |
157 last_upload_ticks_ = TimeTicks::Now(); | 157 last_upload_ticks_ = TimeTicks::Now(); |
158 last_upload_position_ = progress.position(); | 158 last_upload_position_ = progress.position(); |
159 } | 159 } |
160 } | 160 } |
161 | 161 |
162 void ResourceLoader::MarkAsTransferring(const GURL& target_url) { | 162 void ResourceLoader::MarkAsTransferring(const GURL& target_url) { |
163 CHECK_EQ(GetRequestInfo()->GetResourceType(), ResourceType::MAIN_FRAME) | 163 // TODO(creis): Why was this check here? Is it a problem for cookies? |
davidben
2013/11/18 22:20:50
I actually came across that line some time ago and
| |
164 << "Cannot transfer non-main frame navigations"; | 164 CHECK(GetRequestInfo()->GetResourceType() == ResourceType::MAIN_FRAME || |
165 GetRequestInfo()->GetResourceType() == ResourceType::SUB_FRAME) | |
166 << "Can only transfer navigations"; | |
165 is_transferring_ = true; | 167 is_transferring_ = true; |
166 | 168 |
167 // When transferring a request to another process, the renderer doesn't get | 169 // When transferring a request to another process, the renderer doesn't get |
168 // a chance to update the cookie policy URL. Do it here instead. | 170 // a chance to update the cookie policy URL. Do it here instead. |
169 request()->set_first_party_for_cookies(target_url); | 171 request()->set_first_party_for_cookies(target_url); |
170 } | 172 } |
171 | 173 |
172 void ResourceLoader::CompleteTransfer() { | 174 void ResourceLoader::CompleteTransfer() { |
173 DCHECK_EQ(DEFERRED_READ, deferred_stage_); | 175 DCHECK_EQ(DEFERRED_READ, deferred_stage_); |
174 | 176 |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
631 case net::URLRequestStatus::FAILED: | 633 case net::URLRequestStatus::FAILED: |
632 status = STATUS_UNDEFINED; | 634 status = STATUS_UNDEFINED; |
633 break; | 635 break; |
634 } | 636 } |
635 | 637 |
636 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); | 638 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); |
637 } | 639 } |
638 } | 640 } |
639 | 641 |
640 } // namespace content | 642 } // namespace content |
OLD | NEW |