| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/child/web_url_loader_impl.h" | 5 #include "content/child/web_url_loader_impl.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 void WebURLLoaderImpl::Context::SetDefersLoading(bool value) { | 436 void WebURLLoaderImpl::Context::SetDefersLoading(bool value) { |
| 437 if (request_id_ != -1) | 437 if (request_id_ != -1) |
| 438 resource_dispatcher_->SetDefersLoading(request_id_, value); | 438 resource_dispatcher_->SetDefersLoading(request_id_, value); |
| 439 if (value && defers_loading_ == NOT_DEFERRING) { | 439 if (value && defers_loading_ == NOT_DEFERRING) { |
| 440 defers_loading_ = SHOULD_DEFER; | 440 defers_loading_ = SHOULD_DEFER; |
| 441 } else if (!value && defers_loading_ != NOT_DEFERRING) { | 441 } else if (!value && defers_loading_ != NOT_DEFERRING) { |
| 442 if (defers_loading_ == DEFERRED_DATA) { | 442 if (defers_loading_ == DEFERRED_DATA) { |
| 443 // TODO(alexclarke): Find a way to let blink and chromium FROM_HERE | 443 // TODO(alexclarke): Find a way to let blink and chromium FROM_HERE |
| 444 // coexist. | 444 // coexist. |
| 445 web_task_runner_->postTask( | 445 web_task_runner_->postTask( |
| 446 BLINK_FROM_HERE, | 446 ::blink::WebTraceLocation(__FUNCTION__, __FILE__), |
| 447 new HandleDataURLTask(this)); | 447 new HandleDataURLTask(this)); |
| 448 } | 448 } |
| 449 defers_loading_ = NOT_DEFERRING; | 449 defers_loading_ = NOT_DEFERRING; |
| 450 } | 450 } |
| 451 } | 451 } |
| 452 | 452 |
| 453 void WebURLLoaderImpl::Context::DidChangePriority( | 453 void WebURLLoaderImpl::Context::DidChangePriority( |
| 454 WebURLRequest::Priority new_priority, int intra_priority_value) { | 454 WebURLRequest::Priority new_priority, int intra_priority_value) { |
| 455 if (request_id_ != -1) { | 455 if (request_id_ != -1) { |
| 456 resource_dispatcher_->DidChangePriority( | 456 resource_dispatcher_->DidChangePriority( |
| (...skipping 13 matching lines...) Expand all Loading... |
| 470 if (sync_load_response) { | 470 if (sync_load_response) { |
| 471 // This is a sync load. Do the work now. | 471 // This is a sync load. Do the work now. |
| 472 sync_load_response->url = url; | 472 sync_load_response->url = url; |
| 473 sync_load_response->error_code = | 473 sync_load_response->error_code = |
| 474 GetInfoFromDataURL(sync_load_response->url, sync_load_response, | 474 GetInfoFromDataURL(sync_load_response->url, sync_load_response, |
| 475 &sync_load_response->data); | 475 &sync_load_response->data); |
| 476 } else { | 476 } else { |
| 477 // TODO(alexclarke): Find a way to let blink and chromium FROM_HERE | 477 // TODO(alexclarke): Find a way to let blink and chromium FROM_HERE |
| 478 // coexist. | 478 // coexist. |
| 479 web_task_runner_->postTask( | 479 web_task_runner_->postTask( |
| 480 BLINK_FROM_HERE, | 480 ::blink::WebTraceLocation(__FUNCTION__, __FILE__), |
| 481 new HandleDataURLTask(this)); | 481 new HandleDataURLTask(this)); |
| 482 } | 482 } |
| 483 return; | 483 return; |
| 484 } | 484 } |
| 485 | 485 |
| 486 if (request.getExtraData()) { | 486 if (request.getExtraData()) { |
| 487 RequestExtraData* extra_data = | 487 RequestExtraData* extra_data = |
| 488 static_cast<RequestExtraData*>(request.getExtraData()); | 488 static_cast<RequestExtraData*>(request.getExtraData()); |
| 489 stream_override_ = extra_data->TakeStreamOverrideOwnership(); | 489 stream_override_ = extra_data->TakeStreamOverrideOwnership(); |
| 490 } | 490 } |
| (...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1227 response->clearHTTPHeaderField(webStringName); | 1227 response->clearHTTPHeaderField(webStringName); |
| 1228 while (response_headers->EnumerateHeader(&iterator, name, &value)) { | 1228 while (response_headers->EnumerateHeader(&iterator, name, &value)) { |
| 1229 response->addHTTPHeaderField(webStringName, | 1229 response->addHTTPHeaderField(webStringName, |
| 1230 WebString::fromLatin1(value)); | 1230 WebString::fromLatin1(value)); |
| 1231 } | 1231 } |
| 1232 } | 1232 } |
| 1233 return true; | 1233 return true; |
| 1234 } | 1234 } |
| 1235 | 1235 |
| 1236 } // namespace content | 1236 } // namespace content |
| OLD | NEW |