Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 11378008: Raise an infobar and deny access to WebGL if a GPU reset was detected while a web page containing W… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanups after restructuring based on review feedback from @jam. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "content/common/request_extra_data.h" 45 #include "content/common/request_extra_data.h"
46 #include "content/common/socket_stream_handle_data.h" 46 #include "content/common/socket_stream_handle_data.h"
47 #include "content/common/view_messages.h" 47 #include "content/common/view_messages.h"
48 #include "content/common/webmessageportchannel_impl.h" 48 #include "content/common/webmessageportchannel_impl.h"
49 #include "content/public/common/bindings_policy.h" 49 #include "content/public/common/bindings_policy.h"
50 #include "content/public/common/content_client.h" 50 #include "content/public/common/content_client.h"
51 #include "content/public/common/content_constants.h" 51 #include "content/public/common/content_constants.h"
52 #include "content/public/common/content_switches.h" 52 #include "content/public/common/content_switches.h"
53 #include "content/public/common/context_menu_params.h" 53 #include "content/public/common/context_menu_params.h"
54 #include "content/public/common/file_chooser_params.h" 54 #include "content/public/common/file_chooser_params.h"
55 #include "content/public/common/three_d_api_types.h"
55 #include "content/public/common/url_constants.h" 56 #include "content/public/common/url_constants.h"
56 #include "content/public/renderer/content_renderer_client.h" 57 #include "content/public/renderer/content_renderer_client.h"
57 #include "content/public/renderer/document_state.h" 58 #include "content/public/renderer/document_state.h"
58 #include "content/public/renderer/navigation_state.h" 59 #include "content/public/renderer/navigation_state.h"
59 #include "content/public/renderer/password_form_conversion_utils.h" 60 #include "content/public/renderer/password_form_conversion_utils.h"
60 #include "content/public/renderer/render_view_observer.h" 61 #include "content/public/renderer/render_view_observer.h"
61 #include "content/public/renderer/render_view_visitor.h" 62 #include "content/public/renderer/render_view_visitor.h"
62 #include "content/renderer/browser_plugin/browser_plugin.h" 63 #include "content/renderer/browser_plugin/browser_plugin.h"
63 #include "content/renderer/browser_plugin/browser_plugin_manager.h" 64 #include "content/renderer/browser_plugin/browser_plugin_manager.h"
64 #include "content/renderer/device_orientation_dispatcher.h" 65 #include "content/renderer/device_orientation_dispatcher.h"
(...skipping 4167 matching lines...) Expand 10 before | Expand all | Expand 10 after
4232 data_source = main_frame->dataSource(); 4233 data_source = main_frame->dataSource();
4233 4234
4234 DocumentState* document_state = 4235 DocumentState* document_state =
4235 data_source ? DocumentState::FromDataSource(data_source) : NULL; 4236 data_source ? DocumentState::FromDataSource(data_source) : NULL;
4236 if (document_state && document_state->is_overriding_user_agent()) 4237 if (document_state && document_state->is_overriding_user_agent())
4237 return WebString::fromUTF8(renderer_preferences_.user_agent_override); 4238 return WebString::fromUTF8(renderer_preferences_.user_agent_override);
4238 else 4239 else
4239 return WebKit::WebString(); 4240 return WebKit::WebString();
4240 } 4241 }
4241 4242
4243 bool RenderViewImpl::allowWebGL(WebFrame* frame, bool default_value) {
4244 if (!default_value)
4245 return false;
4246
4247 bool blocked = true;
4248 Send(new ViewHostMsg_Are3DAPIsBlocked(
4249 routing_id_,
4250 GURL(frame->top()->document().securityOrigin().toString()),
4251 THREE_D_API_TYPE_WEBGL,
4252 &blocked));
4253 return !blocked;
4254 }
4255
4256 void RenderViewImpl::didLoseWebGLContext(
4257 WebKit::WebFrame* frame,
4258 int arb_robustness_status_code) {
4259 Send(new ViewHostMsg_DidLose3DContext(
4260 GURL(frame->top()->document().securityOrigin().toString()),
4261 THREE_D_API_TYPE_WEBGL,
4262 arb_robustness_status_code));
4263 }
4264
4242 // WebKit::WebPageSerializerClient implementation ------------------------------ 4265 // WebKit::WebPageSerializerClient implementation ------------------------------
4243 4266
4244 void RenderViewImpl::didSerializeDataForFrame( 4267 void RenderViewImpl::didSerializeDataForFrame(
4245 const WebURL& frame_url, 4268 const WebURL& frame_url,
4246 const WebCString& data, 4269 const WebCString& data,
4247 WebPageSerializerClient::PageSerializationStatus status) { 4270 WebPageSerializerClient::PageSerializationStatus status) {
4248 Send(new ViewHostMsg_SendSerializedHtmlData( 4271 Send(new ViewHostMsg_SendSerializedHtmlData(
4249 routing_id(), 4272 routing_id(),
4250 frame_url, 4273 frame_url,
4251 data.data(), 4274 data.data(),
(...skipping 2140 matching lines...) Expand 10 before | Expand all | Expand 10 after
6392 } 6415 }
6393 #endif 6416 #endif
6394 6417
6395 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( 6418 void RenderViewImpl::OnReleaseDisambiguationPopupDIB(
6396 TransportDIB::Handle dib_handle) { 6419 TransportDIB::Handle dib_handle) {
6397 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); 6420 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle);
6398 RenderProcess::current()->ReleaseTransportDIB(dib); 6421 RenderProcess::current()->ReleaseTransportDIB(dib);
6399 } 6422 }
6400 6423
6401 } // namespace content 6424 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698