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

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

Issue 233093006: Stop disabling force_compositing_mode for background RenderViews. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: background: test Created 6 years, 8 months 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/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 result.setFilesystemId(drop_data.filesystem_id); 635 result.setFilesystemId(drop_data.filesystem_id);
636 return result; 636 return result;
637 } 637 }
638 638
639 } // namespace 639 } // namespace
640 640
641 RenderViewImpl::RenderViewImpl(RenderViewImplParams* params) 641 RenderViewImpl::RenderViewImpl(RenderViewImplParams* params)
642 : RenderWidget(blink::WebPopupTypeNone, 642 : RenderWidget(blink::WebPopupTypeNone,
643 params->screen_info, 643 params->screen_info,
644 params->swapped_out, 644 params->swapped_out,
645 params->hidden), 645 params->hidden,
646 params->background),
646 webkit_preferences_(params->webkit_prefs), 647 webkit_preferences_(params->webkit_prefs),
647 send_content_state_immediately_(false), 648 send_content_state_immediately_(false),
648 enabled_bindings_(0), 649 enabled_bindings_(0),
649 send_preferred_size_changes_(false), 650 send_preferred_size_changes_(false),
650 navigation_gesture_(NavigationGestureUnknown), 651 navigation_gesture_(NavigationGestureUnknown),
651 opened_by_user_gesture_(true), 652 opened_by_user_gesture_(true),
652 opener_suppressed_(false), 653 opener_suppressed_(false),
653 suppress_dialogs_until_swap_out_(false), 654 suppress_dialogs_until_swap_out_(false),
654 page_id_(-1), 655 page_id_(-1),
655 last_page_id_sent_to_browser_(-1), 656 last_page_id_sent_to_browser_(-1),
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 const RendererPreferences& renderer_prefs, 920 const RendererPreferences& renderer_prefs,
920 const WebPreferences& webkit_prefs, 921 const WebPreferences& webkit_prefs,
921 int32 routing_id, 922 int32 routing_id,
922 int32 main_frame_routing_id, 923 int32 main_frame_routing_id,
923 int32 surface_id, 924 int32 surface_id,
924 int64 session_storage_namespace_id, 925 int64 session_storage_namespace_id,
925 const base::string16& frame_name, 926 const base::string16& frame_name,
926 bool is_renderer_created, 927 bool is_renderer_created,
927 bool swapped_out, 928 bool swapped_out,
928 bool hidden, 929 bool hidden,
930 bool background,
929 int32 next_page_id, 931 int32 next_page_id,
930 const blink::WebScreenInfo& screen_info, 932 const blink::WebScreenInfo& screen_info,
931 AccessibilityMode accessibility_mode) { 933 AccessibilityMode accessibility_mode) {
932 DCHECK(routing_id != MSG_ROUTING_NONE); 934 DCHECK(routing_id != MSG_ROUTING_NONE);
933 RenderViewImplParams params(opener_id, 935 RenderViewImplParams params(opener_id,
934 renderer_prefs, 936 renderer_prefs,
935 webkit_prefs, 937 webkit_prefs,
936 routing_id, 938 routing_id,
937 main_frame_routing_id, 939 main_frame_routing_id,
938 surface_id, 940 surface_id,
939 session_storage_namespace_id, 941 session_storage_namespace_id,
940 frame_name, 942 frame_name,
941 is_renderer_created, 943 is_renderer_created,
942 swapped_out, 944 swapped_out,
943 hidden, 945 hidden,
946 background,
944 next_page_id, 947 next_page_id,
945 screen_info, 948 screen_info,
946 accessibility_mode); 949 accessibility_mode);
947 RenderViewImpl* render_view = NULL; 950 RenderViewImpl* render_view = NULL;
948 if (g_create_render_view_impl) 951 if (g_create_render_view_impl)
949 render_view = g_create_render_view_impl(&params); 952 render_view = g_create_render_view_impl(&params);
950 else 953 else
951 render_view = new RenderViewImpl(&params); 954 render_view = new RenderViewImpl(&params);
952 render_view->Initialize(&params); 955 render_view->Initialize(&params);
953 return render_view; 956 return render_view;
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
1512 new ViewHostMsg_CreateWindow(params, 1515 new ViewHostMsg_CreateWindow(params,
1513 &routing_id, 1516 &routing_id,
1514 &main_frame_routing_id, 1517 &main_frame_routing_id,
1515 &surface_id, 1518 &surface_id,
1516 &cloned_session_storage_namespace_id)); 1519 &cloned_session_storage_namespace_id));
1517 if (routing_id == MSG_ROUTING_NONE) 1520 if (routing_id == MSG_ROUTING_NONE)
1518 return NULL; 1521 return NULL;
1519 1522
1520 WebUserGestureIndicator::consumeUserGesture(); 1523 WebUserGestureIndicator::consumeUserGesture();
1521 1524
1522 WebPreferences transferred_preferences = webkit_preferences_; 1525 // While this view may be a background extension page, it can spawn a visible
1523 1526 // render view. So we just assume that the new one is not another background
1524 // Unless accelerated compositing has been explicitly disabled from the 1527 // page instead of passing on our own value.
1525 // command line (e.g. via the blacklist or about:flags) re-enable it for 1528 // TODO(vangelis): Can we call if the new view will be a background page?
1526 // new views that get spawned by this view. This gets around the issue that 1529 bool is_background = false;
1527 // background extension pages disable accelerated compositing via web prefs
1528 // but can themselves spawn a visible render view which should be allowed
1529 // use gpu acceleration.
1530 if (!webkit_preferences_.accelerated_compositing_enabled) {
1531 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
1532 if (!command_line.HasSwitch(switches::kDisableAcceleratedCompositing))
1533 transferred_preferences.accelerated_compositing_enabled = true;
1534 }
1535 1530
1536 // The initial hidden state for the RenderViewImpl here has to match what the 1531 // The initial hidden state for the RenderViewImpl here has to match what the
1537 // browser will eventually decide for the given disposition. Since we have to 1532 // browser will eventually decide for the given disposition. Since we have to
1538 // return from this call synchronously, we just have to make our best guess 1533 // return from this call synchronously, we just have to make our best guess
1539 // and rely on the browser sending a WasHidden / WasShown message if it 1534 // and rely on the browser sending a WasHidden / WasShown message if it
1540 // disagrees. 1535 // disagrees.
1541 RenderViewImpl* view = RenderViewImpl::Create( 1536 RenderViewImpl* view = RenderViewImpl::Create(
1542 routing_id_, 1537 routing_id_,
1543 renderer_preferences_, 1538 renderer_preferences_,
1544 transferred_preferences, 1539 webkit_preferences_,
1545 routing_id, 1540 routing_id,
1546 main_frame_routing_id, 1541 main_frame_routing_id,
1547 surface_id, 1542 surface_id,
1548 cloned_session_storage_namespace_id, 1543 cloned_session_storage_namespace_id,
1549 base::string16(), // WebCore will take care of setting the correct name. 1544 base::string16(), // WebCore will take care of setting the correct name.
1550 true, // is_renderer_created 1545 true, // is_renderer_created
1551 false, // swapped_out 1546 false, // swapped_out
1547 is_background,
1552 params.disposition == NEW_BACKGROUND_TAB, // hidden 1548 params.disposition == NEW_BACKGROUND_TAB, // hidden
1553 1, // next_page_id 1549 1, // next_page_id
1554 screen_info_, 1550 screen_info_,
1555 accessibility_mode_); 1551 accessibility_mode_);
1556 view->opened_by_user_gesture_ = params.user_gesture; 1552 view->opened_by_user_gesture_ = params.user_gesture;
1557 1553
1558 // Record whether the creator frame is trying to suppress the opener field. 1554 // Record whether the creator frame is trying to suppress the opener field.
1559 view->opener_suppressed_ = params.opener_suppressed; 1555 view->opener_suppressed_ = params.opener_suppressed;
1560 1556
1561 return view->webview(); 1557 return view->webview();
(...skipping 3196 matching lines...) Expand 10 before | Expand all | Expand 10 after
4758 std::vector<gfx::Size> sizes(icon_urls[i].sizes().size()); 4754 std::vector<gfx::Size> sizes(icon_urls[i].sizes().size());
4759 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4755 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4760 if (!url.isEmpty()) 4756 if (!url.isEmpty())
4761 urls.push_back( 4757 urls.push_back(
4762 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4758 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4763 } 4759 }
4764 SendUpdateFaviconURL(urls); 4760 SendUpdateFaviconURL(urls);
4765 } 4761 }
4766 4762
4767 } // namespace content 4763 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698