| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "base/time/time.h" | 21 #include "base/time/time.h" |
| 22 #include "content/child/appcache/appcache_dispatcher.h" | 22 #include "content/child/appcache/appcache_dispatcher.h" |
| 23 #include "content/child/plugin_messages.h" | 23 #include "content/child/plugin_messages.h" |
| 24 #include "content/child/quota_dispatcher.h" | 24 #include "content/child/quota_dispatcher.h" |
| 25 #include "content/child/request_extra_data.h" | 25 #include "content/child/request_extra_data.h" |
| 26 #include "content/child/service_worker/service_worker_network_provider.h" | 26 #include "content/child/service_worker/service_worker_network_provider.h" |
| 27 #include "content/child/service_worker/web_service_worker_provider_impl.h" | 27 #include "content/child/service_worker/web_service_worker_provider_impl.h" |
| 28 #include "content/child/web_socket_stream_handle_impl.h" | 28 #include "content/child/web_socket_stream_handle_impl.h" |
| 29 #include "content/child/webmessageportchannel_impl.h" | 29 #include "content/child/webmessageportchannel_impl.h" |
| 30 #include "content/child/websocket_bridge.h" | 30 #include "content/child/websocket_bridge.h" |
| 31 #include "content/child/weburlresponse_extradata_impl.h" |
| 31 #include "content/common/clipboard_messages.h" | 32 #include "content/common/clipboard_messages.h" |
| 32 #include "content/common/frame_messages.h" | 33 #include "content/common/frame_messages.h" |
| 33 #include "content/common/input_messages.h" | 34 #include "content/common/input_messages.h" |
| 34 #include "content/common/service_worker/service_worker_types.h" | 35 #include "content/common/service_worker/service_worker_types.h" |
| 35 #include "content/common/socket_stream_handle_data.h" | 36 #include "content/common/socket_stream_handle_data.h" |
| 36 #include "content/common/swapped_out_messages.h" | 37 #include "content/common/swapped_out_messages.h" |
| 37 #include "content/common/view_messages.h" | 38 #include "content/common/view_messages.h" |
| 38 #include "content/public/common/bindings_policy.h" | 39 #include "content/public/common/bindings_policy.h" |
| 39 #include "content/public/common/content_constants.h" | 40 #include "content/public/common/content_constants.h" |
| 40 #include "content/public/common/content_switches.h" | 41 #include "content/public/common/content_switches.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 #include "third_party/WebKit/public/web/WebPlugin.h" | 103 #include "third_party/WebKit/public/web/WebPlugin.h" |
| 103 #include "third_party/WebKit/public/web/WebPluginParams.h" | 104 #include "third_party/WebKit/public/web/WebPluginParams.h" |
| 104 #include "third_party/WebKit/public/web/WebRange.h" | 105 #include "third_party/WebKit/public/web/WebRange.h" |
| 105 #include "third_party/WebKit/public/web/WebScriptSource.h" | 106 #include "third_party/WebKit/public/web/WebScriptSource.h" |
| 106 #include "third_party/WebKit/public/web/WebSearchableFormData.h" | 107 #include "third_party/WebKit/public/web/WebSearchableFormData.h" |
| 107 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" | 108 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" |
| 108 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 109 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
| 109 #include "third_party/WebKit/public/web/WebSurroundingText.h" | 110 #include "third_party/WebKit/public/web/WebSurroundingText.h" |
| 110 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" | 111 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
| 111 #include "third_party/WebKit/public/web/WebView.h" | 112 #include "third_party/WebKit/public/web/WebView.h" |
| 112 #include "webkit/child/weburlresponse_extradata_impl.h" | |
| 113 | 113 |
| 114 #if defined(ENABLE_PLUGINS) | 114 #if defined(ENABLE_PLUGINS) |
| 115 #include "content/renderer/npapi/webplugin_impl.h" | 115 #include "content/renderer/npapi/webplugin_impl.h" |
| 116 #include "content/renderer/pepper/pepper_browser_connection.h" | 116 #include "content/renderer/pepper/pepper_browser_connection.h" |
| 117 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 117 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
| 118 #include "content/renderer/pepper/pepper_webplugin_impl.h" | 118 #include "content/renderer/pepper/pepper_webplugin_impl.h" |
| 119 #include "content/renderer/pepper/plugin_module.h" | 119 #include "content/renderer/pepper/plugin_module.h" |
| 120 #endif | 120 #endif |
| 121 | 121 |
| 122 #if defined(ENABLE_WEBRTC) | 122 #if defined(ENABLE_WEBRTC) |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 using blink::WebString; | 164 using blink::WebString; |
| 165 using blink::WebURL; | 165 using blink::WebURL; |
| 166 using blink::WebURLError; | 166 using blink::WebURLError; |
| 167 using blink::WebURLRequest; | 167 using blink::WebURLRequest; |
| 168 using blink::WebURLResponse; | 168 using blink::WebURLResponse; |
| 169 using blink::WebUserGestureIndicator; | 169 using blink::WebUserGestureIndicator; |
| 170 using blink::WebVector; | 170 using blink::WebVector; |
| 171 using blink::WebView; | 171 using blink::WebView; |
| 172 using base::Time; | 172 using base::Time; |
| 173 using base::TimeDelta; | 173 using base::TimeDelta; |
| 174 using webkit_glue::WebURLResponseExtraDataImpl; | |
| 175 | 174 |
| 176 namespace content { | 175 namespace content { |
| 177 | 176 |
| 178 namespace { | 177 namespace { |
| 179 | 178 |
| 180 const char kDefaultAcceptHeader[] = | 179 const char kDefaultAcceptHeader[] = |
| 181 "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/" | 180 "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/" |
| 182 "*;q=0.8"; | 181 "*;q=0.8"; |
| 183 const char kAcceptHeader[] = "Accept"; | 182 const char kAcceptHeader[] = "Accept"; |
| 184 | 183 |
| (...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1325 } | 1324 } |
| 1326 | 1325 |
| 1327 void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) { | 1326 void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) { |
| 1328 OnJavaScriptExecuteRequest(javascript, 0, false); | 1327 OnJavaScriptExecuteRequest(javascript, 0, false); |
| 1329 } | 1328 } |
| 1330 | 1329 |
| 1331 ServiceRegistry* RenderFrameImpl::GetServiceRegistry() { | 1330 ServiceRegistry* RenderFrameImpl::GetServiceRegistry() { |
| 1332 return &service_registry_; | 1331 return &service_registry_; |
| 1333 } | 1332 } |
| 1334 | 1333 |
| 1334 bool RenderFrameImpl::IsFTPDirectoryListing( |
| 1335 const blink::WebURLResponse& response) { |
| 1336 WebURLResponseExtraDataImpl* extra_data = GetExtraDataFromResponse(response); |
| 1337 return extra_data ? extra_data->is_ftp_directory_listing() : false; |
| 1338 } |
| 1339 |
| 1335 // blink::WebFrameClient implementation ---------------------------------------- | 1340 // blink::WebFrameClient implementation ---------------------------------------- |
| 1336 | 1341 |
| 1337 blink::WebPlugin* RenderFrameImpl::createPlugin( | 1342 blink::WebPlugin* RenderFrameImpl::createPlugin( |
| 1338 blink::WebLocalFrame* frame, | 1343 blink::WebLocalFrame* frame, |
| 1339 const blink::WebPluginParams& params) { | 1344 const blink::WebPluginParams& params) { |
| 1340 DCHECK_EQ(frame_, frame); | 1345 DCHECK_EQ(frame_, frame); |
| 1341 blink::WebPlugin* plugin = NULL; | 1346 blink::WebPlugin* plugin = NULL; |
| 1342 if (GetContentClient()->renderer()->OverrideCreatePlugin( | 1347 if (GetContentClient()->renderer()->OverrideCreatePlugin( |
| 1343 this, frame, params, &plugin)) { | 1348 this, frame, params, &plugin)) { |
| 1344 return plugin; | 1349 return plugin; |
| (...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2527 // If we are in view source mode, then just let the user see the source of | 2532 // If we are in view source mode, then just let the user see the source of |
| 2528 // the server's error page. | 2533 // the server's error page. |
| 2529 if (frame->isViewSourceModeEnabled()) | 2534 if (frame->isViewSourceModeEnabled()) |
| 2530 return; | 2535 return; |
| 2531 | 2536 |
| 2532 DocumentState* document_state = | 2537 DocumentState* document_state = |
| 2533 DocumentState::FromDataSource(frame->provisionalDataSource()); | 2538 DocumentState::FromDataSource(frame->provisionalDataSource()); |
| 2534 int http_status_code = response.httpStatusCode(); | 2539 int http_status_code = response.httpStatusCode(); |
| 2535 | 2540 |
| 2536 // Record page load flags. | 2541 // Record page load flags. |
| 2537 WebURLResponseExtraDataImpl* extra_data = | 2542 WebURLResponseExtraDataImpl* extra_data = GetExtraDataFromResponse(response); |
| 2538 GetExtraDataFromResponse(response); | |
| 2539 if (extra_data) { | 2543 if (extra_data) { |
| 2540 document_state->set_was_fetched_via_spdy( | 2544 document_state->set_was_fetched_via_spdy( |
| 2541 extra_data->was_fetched_via_spdy()); | 2545 extra_data->was_fetched_via_spdy()); |
| 2542 document_state->set_was_npn_negotiated( | 2546 document_state->set_was_npn_negotiated( |
| 2543 extra_data->was_npn_negotiated()); | 2547 extra_data->was_npn_negotiated()); |
| 2544 document_state->set_npn_negotiated_protocol( | 2548 document_state->set_npn_negotiated_protocol( |
| 2545 extra_data->npn_negotiated_protocol()); | 2549 extra_data->npn_negotiated_protocol()); |
| 2546 document_state->set_was_alternate_protocol_available( | 2550 document_state->set_was_alternate_protocol_available( |
| 2547 extra_data->was_alternate_protocol_available()); | 2551 extra_data->was_alternate_protocol_available()); |
| 2548 document_state->set_connection_info( | 2552 document_state->set_connection_info( |
| (...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3561 | 3565 |
| 3562 #if defined(ENABLE_BROWSER_CDMS) | 3566 #if defined(ENABLE_BROWSER_CDMS) |
| 3563 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 3567 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
| 3564 if (!cdm_manager_) | 3568 if (!cdm_manager_) |
| 3565 cdm_manager_ = new RendererCdmManager(this); | 3569 cdm_manager_ = new RendererCdmManager(this); |
| 3566 return cdm_manager_; | 3570 return cdm_manager_; |
| 3567 } | 3571 } |
| 3568 #endif // defined(ENABLE_BROWSER_CDMS) | 3572 #endif // defined(ENABLE_BROWSER_CDMS) |
| 3569 | 3573 |
| 3570 } // namespace content | 3574 } // namespace content |
| OLD | NEW |