OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "content/browser/loader/resource_loader.h" | 5 #include "content/browser/loader/resource_loader.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <deque> | 10 #include <deque> |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 // frame. | 420 // frame. |
421 ASSERT_TRUE((resource_type != RESOURCE_TYPE_MAIN_FRAME) || | 421 ASSERT_TRUE((resource_type != RESOURCE_TYPE_MAIN_FRAME) || |
422 belongs_to_main_frame); | 422 belongs_to_main_frame); |
423 | 423 |
424 RenderFrameHost* rfh = web_contents_->GetMainFrame(); | 424 RenderFrameHost* rfh = web_contents_->GetMainFrame(); |
425 ResourceRequestInfo::AllocateForTesting( | 425 ResourceRequestInfo::AllocateForTesting( |
426 request.get(), resource_type, &resource_context_, | 426 request.get(), resource_type, &resource_context_, |
427 rfh->GetProcess()->GetID(), rfh->GetRenderViewHost()->GetRoutingID(), | 427 rfh->GetProcess()->GetID(), rfh->GetRenderViewHost()->GetRoutingID(), |
428 rfh->GetRoutingID(), belongs_to_main_frame, | 428 rfh->GetRoutingID(), belongs_to_main_frame, |
429 false /* parent_is_main_frame */, true /* allow_download */, | 429 false /* parent_is_main_frame */, true /* allow_download */, |
430 false /* is_async */, false /* is_using_lofi_ */); | 430 false /* is_async */, PREVIEWS_OFF /* previews_state */); |
431 std::unique_ptr<TestResourceHandler> resource_handler( | 431 std::unique_ptr<TestResourceHandler> resource_handler( |
432 new TestResourceHandler(nullptr, nullptr)); | 432 new TestResourceHandler(nullptr, nullptr)); |
433 raw_ptr_resource_handler_ = resource_handler.get(); | 433 raw_ptr_resource_handler_ = resource_handler.get(); |
434 loader_.reset(new ResourceLoader( | 434 loader_.reset(new ResourceLoader( |
435 std::move(request), | 435 std::move(request), |
436 WrapResourceHandler(std::move(resource_handler), raw_ptr_to_request_), | 436 WrapResourceHandler(std::move(resource_handler), raw_ptr_to_request_), |
437 this)); | 437 this)); |
438 } | 438 } |
439 | 439 |
440 void SetUpResourceLoaderForUrl(const GURL& test_url) { | 440 void SetUpResourceLoaderForUrl(const GURL& test_url) { |
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1719 | 1719 |
1720 // Tests that the effective connection type is not set on non-main frame | 1720 // Tests that the effective connection type is not set on non-main frame |
1721 // requests. | 1721 // requests. |
1722 TEST_F(EffectiveConnectionTypeResourceLoaderTest, DoesNotBelongToMainFrame) { | 1722 TEST_F(EffectiveConnectionTypeResourceLoaderTest, DoesNotBelongToMainFrame) { |
1723 VerifyEffectiveConnectionType(RESOURCE_TYPE_OBJECT, false, | 1723 VerifyEffectiveConnectionType(RESOURCE_TYPE_OBJECT, false, |
1724 net::EFFECTIVE_CONNECTION_TYPE_3G, | 1724 net::EFFECTIVE_CONNECTION_TYPE_3G, |
1725 net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN); | 1725 net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN); |
1726 } | 1726 } |
1727 | 1727 |
1728 } // namespace content | 1728 } // namespace content |
OLD | NEW |