Chromium Code Reviews| 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 #include "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 152 #include "webkit/forms/form_data.h" | 152 #include "webkit/forms/form_data.h" |
| 153 #include "webkit/forms/form_field.h" | 153 #include "webkit/forms/form_field.h" |
| 154 #include "webkit/forms/password_form_dom_manager.h" | 154 #include "webkit/forms/password_form_dom_manager.h" |
| 155 #include "webkit/glue/alt_error_page_resource_fetcher.h" | 155 #include "webkit/glue/alt_error_page_resource_fetcher.h" |
| 156 #include "webkit/glue/dom_operations.h" | 156 #include "webkit/glue/dom_operations.h" |
| 157 #include "webkit/glue/glue_serialize.h" | 157 #include "webkit/glue/glue_serialize.h" |
| 158 #include "webkit/glue/webdropdata.h" | 158 #include "webkit/glue/webdropdata.h" |
| 159 #include "webkit/glue/webkit_constants.h" | 159 #include "webkit/glue/webkit_constants.h" |
| 160 #include "webkit/glue/webkit_glue.h" | 160 #include "webkit/glue/webkit_glue.h" |
| 161 #include "webkit/glue/weburlloader_impl.h" | 161 #include "webkit/glue/weburlloader_impl.h" |
| 162 #include "webkit/glue/weburlresponse_extradata_impl.h" | |
| 162 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" | 163 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" |
| 163 #include "webkit/media/webmediaplayer_impl.h" | 164 #include "webkit/media/webmediaplayer_impl.h" |
| 164 #include "webkit/plugins/npapi/plugin_list.h" | 165 #include "webkit/plugins/npapi/plugin_list.h" |
| 165 #include "webkit/plugins/npapi/webplugin_delegate.h" | 166 #include "webkit/plugins/npapi/webplugin_delegate.h" |
| 166 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 167 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
| 167 #include "webkit/plugins/npapi/webplugin_impl.h" | 168 #include "webkit/plugins/npapi/webplugin_impl.h" |
| 168 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" | 169 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" |
| 169 | 170 |
| 170 #if defined(OS_WIN) | 171 #if defined(OS_WIN) |
| 171 // TODO(port): these files are currently Windows only because they concern: | 172 // TODO(port): these files are currently Windows only because they concern: |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 261 using content::RenderThread; | 262 using content::RenderThread; |
| 262 using content::RenderViewObserver; | 263 using content::RenderViewObserver; |
| 263 using content::RenderViewVisitor; | 264 using content::RenderViewVisitor; |
| 264 using content::Referrer; | 265 using content::Referrer; |
| 265 using content::V8ValueConverter; | 266 using content::V8ValueConverter; |
| 266 using webkit::forms::FormField; | 267 using webkit::forms::FormField; |
| 267 using webkit::forms::PasswordForm; | 268 using webkit::forms::PasswordForm; |
| 268 using webkit::forms::PasswordFormDomManager; | 269 using webkit::forms::PasswordFormDomManager; |
| 269 using webkit_glue::AltErrorPageResourceFetcher; | 270 using webkit_glue::AltErrorPageResourceFetcher; |
| 270 using webkit_glue::ResourceFetcher; | 271 using webkit_glue::ResourceFetcher; |
| 272 using webkit_glue::WebURLResponseExtraDataImpl; | |
| 271 | 273 |
| 272 //----------------------------------------------------------------------------- | 274 //----------------------------------------------------------------------------- |
| 273 | 275 |
| 274 typedef std::map<WebKit::WebView*, RenderViewImpl*> ViewMap; | 276 typedef std::map<WebKit::WebView*, RenderViewImpl*> ViewMap; |
| 275 static base::LazyInstance<ViewMap> g_view_map = LAZY_INSTANCE_INITIALIZER; | 277 static base::LazyInstance<ViewMap> g_view_map = LAZY_INSTANCE_INITIALIZER; |
| 276 | 278 |
| 277 // Time, in seconds, we delay before sending content state changes (such as form | 279 // Time, in seconds, we delay before sending content state changes (such as form |
| 278 // state and scroll position) to the browser. We delay sending changes to avoid | 280 // state and scroll position) to the browser. We delay sending changes to avoid |
| 279 // spamming the browser. | 281 // spamming the browser. |
| 280 // To avoid having tab/session restore require sending a message to get the | 282 // To avoid having tab/session restore require sending a message to get the |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 318 params.navigation_type == ViewMsg_Navigate_Type::RELOAD_IGNORING_CACHE; | 320 params.navigation_type == ViewMsg_Navigate_Type::RELOAD_IGNORING_CACHE; |
| 319 } | 321 } |
| 320 | 322 |
| 321 static WebReferrerPolicy getReferrerPolicyFromRequest( | 323 static WebReferrerPolicy getReferrerPolicyFromRequest( |
| 322 const WebURLRequest& request) { | 324 const WebURLRequest& request) { |
| 323 return request.extraData() ? | 325 return request.extraData() ? |
| 324 static_cast<RequestExtraData*>(request.extraData())->referrer_policy() : | 326 static_cast<RequestExtraData*>(request.extraData())->referrer_policy() : |
| 325 WebKit::WebReferrerPolicyDefault; | 327 WebKit::WebReferrerPolicyDefault; |
| 326 } | 328 } |
| 327 | 329 |
| 330 static WebURLResponseExtraDataImpl* getExtraDataFromResponse( | |
|
Ryan Sleevi
2012/02/17 22:10:24
While I understand this matches the style of getRe
| |
| 331 const WebURLResponse& response) { | |
| 332 return static_cast<WebURLResponseExtraDataImpl*>( | |
| 333 response.extraData()); | |
| 334 } | |
| 335 | |
| 328 NOINLINE static void CrashIntentionally() { | 336 NOINLINE static void CrashIntentionally() { |
| 329 // NOTE(shess): Crash directly rather than using NOTREACHED() so | 337 // NOTE(shess): Crash directly rather than using NOTREACHED() so |
| 330 // that the signature is easier to triage in crash reports. | 338 // that the signature is easier to triage in crash reports. |
| 331 volatile int* zero = NULL; | 339 volatile int* zero = NULL; |
| 332 *zero = 0; | 340 *zero = 0; |
| 333 } | 341 } |
| 334 | 342 |
| 335 static void MaybeHandleDebugURL(const GURL& url) { | 343 static void MaybeHandleDebugURL(const GURL& url) { |
| 336 if (!url.SchemeIs(chrome::kChromeUIScheme)) | 344 if (!url.SchemeIs(chrome::kChromeUIScheme)) |
| 337 return; | 345 return; |
| (...skipping 2658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2996 if (frame->isViewSourceModeEnabled()) | 3004 if (frame->isViewSourceModeEnabled()) |
| 2997 return; | 3005 return; |
| 2998 | 3006 |
| 2999 DocumentState* document_state = | 3007 DocumentState* document_state = |
| 3000 DocumentState::FromDataSource(frame->provisionalDataSource()); | 3008 DocumentState::FromDataSource(frame->provisionalDataSource()); |
| 3001 int http_status_code = response.httpStatusCode(); | 3009 int http_status_code = response.httpStatusCode(); |
| 3002 | 3010 |
| 3003 // Record page load flags. | 3011 // Record page load flags. |
| 3004 document_state->set_was_fetched_via_spdy(response.wasFetchedViaSPDY()); | 3012 document_state->set_was_fetched_via_spdy(response.wasFetchedViaSPDY()); |
| 3005 document_state->set_was_npn_negotiated(response.wasNpnNegotiated()); | 3013 document_state->set_was_npn_negotiated(response.wasNpnNegotiated()); |
| 3014 WebURLResponseExtraDataImpl* extra_data = getExtraDataFromResponse(response); | |
| 3015 document_state->set_npn_negotiated_protocol( | |
| 3016 extra_data->npn_negotiated_protocol()); | |
| 3006 document_state->set_was_alternate_protocol_available( | 3017 document_state->set_was_alternate_protocol_available( |
| 3007 response.wasAlternateProtocolAvailable()); | 3018 response.wasAlternateProtocolAvailable()); |
| 3008 document_state->set_was_fetched_via_proxy(response.wasFetchedViaProxy()); | 3019 document_state->set_was_fetched_via_proxy(response.wasFetchedViaProxy()); |
| 3009 document_state->set_http_status_code(http_status_code); | 3020 document_state->set_http_status_code(http_status_code); |
| 3010 // Whether or not the http status code actually corresponds to an error is | 3021 // Whether or not the http status code actually corresponds to an error is |
| 3011 // only checked when the page is done loading, if |use_error_page| is | 3022 // only checked when the page is done loading, if |use_error_page| is |
| 3012 // still true. | 3023 // still true. |
| 3013 document_state->set_use_error_page(true); | 3024 document_state->set_use_error_page(true); |
| 3014 } | 3025 } |
| 3015 | 3026 |
| (...skipping 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5045 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5056 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
| 5046 return !!RenderThreadImpl::current()->compositor_thread(); | 5057 return !!RenderThreadImpl::current()->compositor_thread(); |
| 5047 } | 5058 } |
| 5048 | 5059 |
| 5049 void RenderViewImpl::OnJavaBridgeInit() { | 5060 void RenderViewImpl::OnJavaBridgeInit() { |
| 5050 DCHECK(!java_bridge_dispatcher_.get()); | 5061 DCHECK(!java_bridge_dispatcher_.get()); |
| 5051 #if defined(ENABLE_JAVA_BRIDGE) | 5062 #if defined(ENABLE_JAVA_BRIDGE) |
| 5052 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 5063 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
| 5053 #endif | 5064 #endif |
| 5054 } | 5065 } |
| OLD | NEW |