OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
6 | 6 |
7 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
8 | 8 |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 #include "content/browser/service_worker/link_header_support.h" | 68 #include "content/browser/service_worker/link_header_support.h" |
69 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 69 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
70 #include "content/browser/service_worker/service_worker_navigation_handle_core.h
" | 70 #include "content/browser/service_worker/service_worker_navigation_handle_core.h
" |
71 #include "content/browser/service_worker/service_worker_request_handler.h" | 71 #include "content/browser/service_worker/service_worker_request_handler.h" |
72 #include "content/browser/streams/stream.h" | 72 #include "content/browser/streams/stream.h" |
73 #include "content/browser/streams/stream_context.h" | 73 #include "content/browser/streams/stream_context.h" |
74 #include "content/browser/streams/stream_registry.h" | 74 #include "content/browser/streams/stream_registry.h" |
75 #include "content/common/net/url_request_service_worker_data.h" | 75 #include "content/common/net/url_request_service_worker_data.h" |
76 #include "content/common/resource_messages.h" | 76 #include "content/common/resource_messages.h" |
77 #include "content/common/resource_request.h" | 77 #include "content/common/resource_request.h" |
78 #include "content/common/resource_request_body_impl.h" | |
79 #include "content/common/resource_request_completion_status.h" | 78 #include "content/common/resource_request_completion_status.h" |
80 #include "content/common/site_isolation_policy.h" | 79 #include "content/common/site_isolation_policy.h" |
81 #include "content/common/view_messages.h" | 80 #include "content/common/view_messages.h" |
82 #include "content/public/browser/browser_thread.h" | 81 #include "content/public/browser/browser_thread.h" |
83 #include "content/public/browser/global_request_id.h" | 82 #include "content/public/browser/global_request_id.h" |
84 #include "content/public/browser/navigation_ui_data.h" | 83 #include "content/public/browser/navigation_ui_data.h" |
85 #include "content/public/browser/plugin_service.h" | 84 #include "content/public/browser/plugin_service.h" |
86 #include "content/public/browser/resource_dispatcher_host_delegate.h" | 85 #include "content/public/browser/resource_dispatcher_host_delegate.h" |
87 #include "content/public/browser/resource_request_details.h" | 86 #include "content/public/browser/resource_request_details.h" |
88 #include "content/public/browser/resource_throttle.h" | 87 #include "content/public/browser/resource_throttle.h" |
89 #include "content/public/browser/stream_handle.h" | 88 #include "content/public/browser/stream_handle.h" |
90 #include "content/public/browser/stream_info.h" | 89 #include "content/public/browser/stream_info.h" |
91 #include "content/public/common/browser_side_navigation_policy.h" | 90 #include "content/public/common/browser_side_navigation_policy.h" |
92 #include "content/public/common/content_features.h" | 91 #include "content/public/common/content_features.h" |
93 #include "content/public/common/content_switches.h" | 92 #include "content/public/common/content_switches.h" |
| 93 #include "content/public/common/resource_request_body.h" |
94 #include "ipc/ipc_message_macros.h" | 94 #include "ipc/ipc_message_macros.h" |
95 #include "ipc/ipc_message_start.h" | 95 #include "ipc/ipc_message_start.h" |
96 #include "net/base/auth.h" | 96 #include "net/base/auth.h" |
97 #include "net/base/load_flags.h" | 97 #include "net/base/load_flags.h" |
98 #include "net/base/mime_util.h" | 98 #include "net/base/mime_util.h" |
99 #include "net/base/net_errors.h" | 99 #include "net/base/net_errors.h" |
100 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 100 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
101 #include "net/base/upload_data_stream.h" | 101 #include "net/base/upload_data_stream.h" |
102 #include "net/cert/cert_status_flags.h" | 102 #include "net/cert/cert_status_flags.h" |
103 #include "net/cookies/cookie_monster.h" | 103 #include "net/cookies/cookie_monster.h" |
(...skipping 2005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2109 net::HttpRequestHeaders headers; | 2109 net::HttpRequestHeaders headers; |
2110 headers.AddHeadersFromString(info.begin_params.headers); | 2110 headers.AddHeadersFromString(info.begin_params.headers); |
2111 new_request->SetExtraRequestHeaders(headers); | 2111 new_request->SetExtraRequestHeaders(headers); |
2112 | 2112 |
2113 new_request->SetLoadFlags(load_flags); | 2113 new_request->SetLoadFlags(load_flags); |
2114 | 2114 |
2115 storage::BlobStorageContext* blob_context = GetBlobStorageContext( | 2115 storage::BlobStorageContext* blob_context = GetBlobStorageContext( |
2116 GetChromeBlobStorageContextForResourceContext(resource_context)); | 2116 GetChromeBlobStorageContextForResourceContext(resource_context)); |
2117 | 2117 |
2118 // Resolve elements from request_body and prepare upload data. | 2118 // Resolve elements from request_body and prepare upload data. |
2119 ResourceRequestBodyImpl* body = info.common_params.post_data.get(); | 2119 ResourceRequestBody* body = info.common_params.post_data.get(); |
2120 BlobHandles blob_handles; | 2120 BlobHandles blob_handles; |
2121 if (body) { | 2121 if (body) { |
2122 if (!GetBodyBlobDataHandles(body, resource_context, &blob_handles)) { | 2122 if (!GetBodyBlobDataHandles(body, resource_context, &blob_handles)) { |
2123 new_request->CancelWithError(net::ERR_INSUFFICIENT_RESOURCES); | 2123 new_request->CancelWithError(net::ERR_INSUFFICIENT_RESOURCES); |
2124 loader->NotifyRequestFailed(false, net::ERR_ABORTED); | 2124 loader->NotifyRequestFailed(false, net::ERR_ABORTED); |
2125 return; | 2125 return; |
2126 } | 2126 } |
2127 new_request->set_upload(UploadDataStreamBuilder::Build( | 2127 new_request->set_upload(UploadDataStreamBuilder::Build( |
2128 body, blob_context, upload_file_system_context, | 2128 body, blob_context, upload_file_system_context, |
2129 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE).get())); | 2129 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE).get())); |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2781 if (iter->second > 2) { | 2781 if (iter->second > 2) { |
2782 active_tabs++; | 2782 active_tabs++; |
2783 if (active_tabs >= 2) | 2783 if (active_tabs >= 2) |
2784 return true; | 2784 return true; |
2785 } | 2785 } |
2786 } | 2786 } |
2787 return false; | 2787 return false; |
2788 } | 2788 } |
2789 | 2789 |
2790 } // namespace content | 2790 } // namespace content |
OLD | NEW |