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

Unified Diff: components/plugins/renderer/loadable_plugin_placeholder.cc

Issue 1124343002: Plugin Power Saver: Enable JS access to throttled plugins. (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 side-by-side diff with in-line comments
Download patch
Index: components/plugins/renderer/loadable_plugin_placeholder.cc
diff --git a/components/plugins/renderer/loadable_plugin_placeholder.cc b/components/plugins/renderer/loadable_plugin_placeholder.cc
index b1567c8642c58ba5b93a648374b355056d57bd1d..8bb9d4ad28c264a74fdd314c32694b839b04689b 100644
--- a/components/plugins/renderer/loadable_plugin_placeholder.cc
+++ b/components/plugins/renderer/loadable_plugin_placeholder.cc
@@ -247,6 +247,17 @@ void LoadablePluginPlaceholder::PluginDestroyed() {
PluginPlaceholder::PluginDestroyed();
}
+v8::Local<v8::Object> LoadablePluginPlaceholder::GetV8ScriptableObject(
+ v8::Isolate* isolate) const {
+#if defined(ENABLE_PLUGINS)
+ // Pass through JavaScript access to the underlying throttled plugin.
+ if (premade_throttler_ && premade_throttler_->GetWebPlugin()) {
+ return premade_throttler_->GetWebPlugin()->v8ScriptableObject(isolate);
+ }
+#endif
+ return v8::Local<v8::Object>();
+}
+
void LoadablePluginPlaceholder::WasShown() {
if (is_blocked_for_background_tab_) {
is_blocked_for_background_tab_ = false;
« no previous file with comments | « components/plugins/renderer/loadable_plugin_placeholder.h ('k') | components/plugins/renderer/plugin_placeholder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698