| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/renderer_host/resource_dispatcher_host.h" | 5 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 } | 74 } |
| 75 | 75 |
| 76 static ResourceHostMsg_Request CreateResourceRequest( | 76 static ResourceHostMsg_Request CreateResourceRequest( |
| 77 const char* method, | 77 const char* method, |
| 78 ResourceType::Type type, | 78 ResourceType::Type type, |
| 79 const GURL& url) { | 79 const GURL& url) { |
| 80 ResourceHostMsg_Request request; | 80 ResourceHostMsg_Request request; |
| 81 request.method = std::string(method); | 81 request.method = std::string(method); |
| 82 request.url = url; | 82 request.url = url; |
| 83 request.first_party_for_cookies = url; // bypass third-party cookie blocking | 83 request.first_party_for_cookies = url; // bypass third-party cookie blocking |
| 84 request.referrer_policy = WebKit::WebReferrerPolicyDefault; |
| 84 request.load_flags = 0; | 85 request.load_flags = 0; |
| 85 request.origin_pid = 0; | 86 request.origin_pid = 0; |
| 86 request.resource_type = type; | 87 request.resource_type = type; |
| 87 request.request_context = 0; | 88 request.request_context = 0; |
| 88 request.appcache_host_id = appcache::kNoHostId; | 89 request.appcache_host_id = appcache::kNoHostId; |
| 89 request.download_to_file = false; | 90 request.download_to_file = false; |
| 90 request.is_main_frame = true; | 91 request.is_main_frame = true; |
| 91 request.frame_id = 0; | 92 request.frame_id = 0; |
| 92 request.parent_is_main_frame = false; | 93 request.parent_is_main_frame = false; |
| 93 request.parent_frame_id = -1; | 94 request.parent_frame_id = -1; |
| (...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1227 EXPECT_EQ(1, host_.pending_requests()); | 1228 EXPECT_EQ(1, host_.pending_requests()); |
| 1228 | 1229 |
| 1229 // Cancelling by other methods shouldn't work either. | 1230 // Cancelling by other methods shouldn't work either. |
| 1230 host_.CancelRequestsForProcess(render_view_id); | 1231 host_.CancelRequestsForProcess(render_view_id); |
| 1231 EXPECT_EQ(1, host_.pending_requests()); | 1232 EXPECT_EQ(1, host_.pending_requests()); |
| 1232 | 1233 |
| 1233 // Cancelling by context should work. | 1234 // Cancelling by context should work. |
| 1234 host_.CancelRequestsForContext(&filter_->resource_context()); | 1235 host_.CancelRequestsForContext(&filter_->resource_context()); |
| 1235 EXPECT_EQ(0, host_.pending_requests()); | 1236 EXPECT_EQ(0, host_.pending_requests()); |
| 1236 } | 1237 } |
| OLD | NEW |