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

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 1114623002: Plugin Power Saver: Make PPS work well with prerendered pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
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 "chrome/renderer/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/crash_logging.h" 8 #include "base/debug/crash_logging.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 #endif // !defined(DISABLE_NACL) && defined(ENABLE_EXTENSIONS) 851 #endif // !defined(DISABLE_NACL) && defined(ENABLE_EXTENSIONS)
852 852
853 #if defined(ENABLE_PLUGINS) 853 #if defined(ENABLE_PLUGINS)
854 // Delay loading plugins if prerendering. 854 // Delay loading plugins if prerendering.
855 // TODO(mmenke): In the case of prerendering, feed into 855 // TODO(mmenke): In the case of prerendering, feed into
856 // ChromeContentRendererClient::CreatePlugin instead, to 856 // ChromeContentRendererClient::CreatePlugin instead, to
857 // reduce the chance of future regressions. 857 // reduce the chance of future regressions.
858 bool is_prerendering = 858 bool is_prerendering =
859 prerender::PrerenderHelper::IsPrerendering(render_frame); 859 prerender::PrerenderHelper::IsPrerendering(render_frame);
860 860
861 // TODO(tommycli): Plugin Power Saver is disabled on prerendered pages. 861 // TODO(tommycli): Background tab plugin deferral is disabled.
862 // This is because the placeholder does not feed back into 862 // This is because the placeholder does not feed back into
863 // ChromeContentRendererClient::CreatePlugin. Because of this, it does 863 // ChromeContentRendererClient::CreatePlugin. Because of this, it does
864 // not handle the preroll to UI overlay placeholder flow correctly. 864 // not handle the preroll to UI overlay placeholder flow correctly.
865 //
866 // Background tab plugin deferral is disabled for the same reason.
867 //
868 // https://crbug.com/471427 865 // https://crbug.com/471427
869 bool power_saver_enabled = 866 bool power_saver_enabled =
870 !is_prerendering &&
871 status == 867 status ==
872 ChromeViewHostMsg_GetPluginInfo_Status::kPlayImportantContent; 868 ChromeViewHostMsg_GetPluginInfo_Status::kPlayImportantContent;
873 869
874 if (info.name == ASCIIToUTF16(content::kFlashPluginName)) 870 if (info.name == ASCIIToUTF16(content::kFlashPluginName))
875 TrackPosterParamPresence(params, power_saver_enabled); 871 TrackPosterParamPresence(params, power_saver_enabled);
876 872
877 PlaceholderPosterInfo poster_info; 873 PlaceholderPosterInfo poster_info;
878 if (power_saver_enabled) { 874 if (power_saver_enabled) {
879 poster_info.poster_attribute = 875 poster_info.poster_attribute =
880 GetPluginInstancePosterAttribute(params); 876 GetPluginInstancePosterAttribute(params);
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
1645 1641
1646 void ChromeContentRendererClient::RecordRappor(const std::string& metric, 1642 void ChromeContentRendererClient::RecordRappor(const std::string& metric,
1647 const std::string& sample) { 1643 const std::string& sample) {
1648 RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRappor(metric, sample)); 1644 RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRappor(metric, sample));
1649 } 1645 }
1650 1646
1651 void ChromeContentRendererClient::RecordRapporURL(const std::string& metric, 1647 void ChromeContentRendererClient::RecordRapporURL(const std::string& metric,
1652 const GURL& url) { 1648 const GURL& url) {
1653 RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRapporURL(metric, url)); 1649 RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRapporURL(metric, url));
1654 } 1650 }
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_browsertest.cc ('k') | chrome/renderer/plugins/chrome_plugin_placeholder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698