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

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: Work around build failure on Mac OS with 10.6 SDK. 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
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/test/data/gpu/webgl.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/context_menu_client.h" 58 #include "content/public/renderer/context_menu_client.h"
58 #include "content/public/renderer/document_state.h" 59 #include "content/public/renderer/document_state.h"
59 #include "content/public/renderer/navigation_state.h" 60 #include "content/public/renderer/navigation_state.h"
60 #include "content/public/renderer/password_form_conversion_utils.h" 61 #include "content/public/renderer/password_form_conversion_utils.h"
61 #include "content/public/renderer/render_view_observer.h" 62 #include "content/public/renderer/render_view_observer.h"
62 #include "content/public/renderer/render_view_visitor.h" 63 #include "content/public/renderer/render_view_visitor.h"
63 #include "content/renderer/browser_plugin/browser_plugin.h" 64 #include "content/renderer/browser_plugin/browser_plugin.h"
64 #include "content/renderer/browser_plugin/browser_plugin_manager.h" 65 #include "content/renderer/browser_plugin/browser_plugin_manager.h"
(...skipping 4180 matching lines...) Expand 10 before | Expand all | Expand 10 after
4245 data_source = main_frame->dataSource(); 4246 data_source = main_frame->dataSource();
4246 4247
4247 DocumentState* document_state = 4248 DocumentState* document_state =
4248 data_source ? DocumentState::FromDataSource(data_source) : NULL; 4249 data_source ? DocumentState::FromDataSource(data_source) : NULL;
4249 if (document_state && document_state->is_overriding_user_agent()) 4250 if (document_state && document_state->is_overriding_user_agent())
4250 return WebString::fromUTF8(renderer_preferences_.user_agent_override); 4251 return WebString::fromUTF8(renderer_preferences_.user_agent_override);
4251 else 4252 else
4252 return WebKit::WebString(); 4253 return WebKit::WebString();
4253 } 4254 }
4254 4255
4256 bool RenderViewImpl::allowWebGL(WebFrame* frame, bool default_value) {
4257 if (!default_value)
4258 return false;
4259
4260 bool blocked = true;
4261 Send(new ViewHostMsg_Are3DAPIsBlocked(
4262 routing_id_,
4263 GURL(frame->top()->document().securityOrigin().toString()),
4264 THREE_D_API_TYPE_WEBGL,
4265 &blocked));
4266 return !blocked;
4267 }
4268
4269 void RenderViewImpl::didLoseWebGLContext(
4270 WebKit::WebFrame* frame,
4271 int arb_robustness_status_code) {
4272 Send(new ViewHostMsg_DidLose3DContext(
4273 GURL(frame->top()->document().securityOrigin().toString()),
4274 THREE_D_API_TYPE_WEBGL,
4275 arb_robustness_status_code));
4276 }
4277
4255 // WebKit::WebPageSerializerClient implementation ------------------------------ 4278 // WebKit::WebPageSerializerClient implementation ------------------------------
4256 4279
4257 void RenderViewImpl::didSerializeDataForFrame( 4280 void RenderViewImpl::didSerializeDataForFrame(
4258 const WebURL& frame_url, 4281 const WebURL& frame_url,
4259 const WebCString& data, 4282 const WebCString& data,
4260 WebPageSerializerClient::PageSerializationStatus status) { 4283 WebPageSerializerClient::PageSerializationStatus status) {
4261 Send(new ViewHostMsg_SendSerializedHtmlData( 4284 Send(new ViewHostMsg_SendSerializedHtmlData(
4262 routing_id(), 4285 routing_id(),
4263 frame_url, 4286 frame_url,
4264 data.data(), 4287 data.data(),
(...skipping 2144 matching lines...) Expand 10 before | Expand all | Expand 10 after
6409 } 6432 }
6410 #endif 6433 #endif
6411 6434
6412 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( 6435 void RenderViewImpl::OnReleaseDisambiguationPopupDIB(
6413 TransportDIB::Handle dib_handle) { 6436 TransportDIB::Handle dib_handle) {
6414 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); 6437 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle);
6415 RenderProcess::current()->ReleaseTransportDIB(dib); 6438 RenderProcess::current()->ReleaseTransportDIB(dib);
6416 } 6439 }
6417 6440
6418 } // namespace content 6441 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/test/data/gpu/webgl.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698