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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 request.url = url; | 76 request.url = url; |
77 request.first_party_for_cookies = url; // bypass third-party cookie blocking | 77 request.first_party_for_cookies = url; // bypass third-party cookie blocking |
78 request.load_flags = 0; | 78 request.load_flags = 0; |
79 request.origin_pid = 0; | 79 request.origin_pid = 0; |
80 request.resource_type = type; | 80 request.resource_type = type; |
81 request.request_context = 0; | 81 request.request_context = 0; |
82 request.appcache_host_id = appcache::kNoHostId; | 82 request.appcache_host_id = appcache::kNoHostId; |
83 request.download_to_file = false; | 83 request.download_to_file = false; |
84 request.is_main_frame = true; | 84 request.is_main_frame = true; |
85 request.frame_id = 0; | 85 request.frame_id = 0; |
86 request.transition_type = PageTransition::LINK; | 86 request.transition_type = content::PAGE_TRANSITION_LINK; |
87 return request; | 87 return request; |
88 } | 88 } |
89 | 89 |
90 // Spin up the message loop to kick off the request. | 90 // Spin up the message loop to kick off the request. |
91 static void KickOffRequest() { | 91 static void KickOffRequest() { |
92 MessageLoop::current()->RunAllPending(); | 92 MessageLoop::current()->RunAllPending(); |
93 } | 93 } |
94 | 94 |
95 // We may want to move this to a shared space if it is useful for something else | 95 // We may want to move this to a shared space if it is useful for something else |
96 class ResourceIPCAccumulator { | 96 class ResourceIPCAccumulator { |
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1248 net::URLRequestStatus status; | 1248 net::URLRequestStatus status; |
1249 | 1249 |
1250 void* iter = NULL; | 1250 void* iter = NULL; |
1251 EXPECT_TRUE(IPC::ReadParam(&msgs[0][0], &iter, &request_id)); | 1251 EXPECT_TRUE(IPC::ReadParam(&msgs[0][0], &iter, &request_id)); |
1252 EXPECT_TRUE(IPC::ReadParam(&msgs[0][0], &iter, &status)); | 1252 EXPECT_TRUE(IPC::ReadParam(&msgs[0][0], &iter, &status)); |
1253 | 1253 |
1254 EXPECT_EQ(1, request_id); | 1254 EXPECT_EQ(1, request_id); |
1255 EXPECT_EQ(net::URLRequestStatus::FAILED, status.status()); | 1255 EXPECT_EQ(net::URLRequestStatus::FAILED, status.status()); |
1256 EXPECT_EQ(net::ERR_UNKNOWN_URL_SCHEME, status.error()); | 1256 EXPECT_EQ(net::ERR_UNKNOWN_URL_SCHEME, status.error()); |
1257 } | 1257 } |
OLD | NEW |