| 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/browser/frame_host/navigation_request.h" | 5 #include "content/browser/frame_host/navigation_request.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "content/browser/devtools/render_frame_devtools_agent_host.h" | 9 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
| 10 #include "content/browser/frame_host/frame_tree.h" | 10 #include "content/browser/frame_host/frame_tree.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 LoFiState lofi_state, | 72 LoFiState lofi_state, |
| 73 bool is_same_document_history_load, | 73 bool is_same_document_history_load, |
| 74 const base::TimeTicks& navigation_start, | 74 const base::TimeTicks& navigation_start, |
| 75 NavigationControllerImpl* controller) { | 75 NavigationControllerImpl* controller) { |
| 76 // Copy existing headers and add necessary headers that may not be present | 76 // Copy existing headers and add necessary headers that may not be present |
| 77 // in the RequestNavigationParams. | 77 // in the RequestNavigationParams. |
| 78 net::HttpRequestHeaders headers; | 78 net::HttpRequestHeaders headers; |
| 79 headers.AddHeadersFromString(entry.extra_headers()); | 79 headers.AddHeadersFromString(entry.extra_headers()); |
| 80 headers.SetHeaderIfMissing(net::HttpRequestHeaders::kUserAgent, | 80 headers.SetHeaderIfMissing(net::HttpRequestHeaders::kUserAgent, |
| 81 GetContentClient()->GetUserAgent()); | 81 GetContentClient()->GetUserAgent()); |
| 82 // TODO(clamy): match what blink is doing with accept headers. | |
| 83 headers.SetHeaderIfMissing("Accept", "*/*"); | |
| 84 | 82 |
| 85 // Fill POST data from the browser in the request body. | 83 // Fill POST data from the browser in the request body. |
| 86 scoped_refptr<ResourceRequestBody> request_body; | 84 scoped_refptr<ResourceRequestBody> request_body; |
| 87 if (entry.GetHasPostData()) { | 85 if (entry.GetHasPostData()) { |
| 88 request_body = new ResourceRequestBody(); | 86 request_body = new ResourceRequestBody(); |
| 89 request_body->AppendBytes( | 87 request_body->AppendBytes( |
| 90 reinterpret_cast<const char *>( | 88 reinterpret_cast<const char *>( |
| 91 entry.GetBrowserInitiatedPostData()->front()), | 89 entry.GetBrowserInitiatedPostData()->front()), |
| 92 entry.GetBrowserInitiatedPostData()->size()); | 90 entry.GetBrowserInitiatedPostData()->size()); |
| 93 } | 91 } |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 browser_context, navigating_frame_host->GetSiteInstance()); | 453 browser_context, navigating_frame_host->GetSiteInstance()); |
| 456 DCHECK(partition); | 454 DCHECK(partition); |
| 457 | 455 |
| 458 ServiceWorkerContextWrapper* service_worker_context = | 456 ServiceWorkerContextWrapper* service_worker_context = |
| 459 static_cast<ServiceWorkerContextWrapper*>( | 457 static_cast<ServiceWorkerContextWrapper*>( |
| 460 partition->GetServiceWorkerContext()); | 458 partition->GetServiceWorkerContext()); |
| 461 navigation_handle_->InitServiceWorkerHandle(service_worker_context); | 459 navigation_handle_->InitServiceWorkerHandle(service_worker_context); |
| 462 } | 460 } |
| 463 | 461 |
| 464 } // namespace content | 462 } // namespace content |
| OLD | NEW |