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

Side by Side Diff: components/plugins/renderer/loadable_plugin_placeholder.cc

Issue 2733083004: Emit error events if the loading of an object element failed (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/plugins/object-onerror-placeholder.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/plugins/renderer/loadable_plugin_placeholder.h" 5 #include "components/plugins/renderer/loadable_plugin_placeholder.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 : PluginPlaceholderBase(render_frame, frame, params, html_data), 64 : PluginPlaceholderBase(render_frame, frame, params, html_data),
65 heuristic_run_before_(false), 65 heuristic_run_before_(false),
66 is_blocked_for_tinyness_(false), 66 is_blocked_for_tinyness_(false),
67 is_blocked_for_background_tab_(false), 67 is_blocked_for_background_tab_(false),
68 is_blocked_for_prerendering_(false), 68 is_blocked_for_prerendering_(false),
69 is_blocked_for_power_saver_poster_(false), 69 is_blocked_for_power_saver_poster_(false),
70 power_saver_enabled_(false), 70 power_saver_enabled_(false),
71 premade_throttler_(nullptr), 71 premade_throttler_(nullptr),
72 allow_loading_(false), 72 allow_loading_(false),
73 finished_loading_(false), 73 finished_loading_(false),
74 weak_factory_(this) {} 74 weak_factory_(this) {
75 plugin()->markAsPlaceholder();
Bernhard Bauer 2017/03/08 14:03:14 If there is a way that the plugin might run eventu
George Joseph 2017/03/08 14:45:57 Hello Bernhard, Thanks for reviewing the change.T
Bernhard Bauer 2017/03/08 18:01:13 Okay, being consistent with Firefox is probably a
George Joseph 2017/03/08 21:20:42 Hello Tommycli and Berhhard, Thanks for getting ba
76 }
75 77
76 LoadablePluginPlaceholder::~LoadablePluginPlaceholder() { 78 LoadablePluginPlaceholder::~LoadablePluginPlaceholder() {
77 } 79 }
78 80
79 void LoadablePluginPlaceholder::MarkPluginEssential( 81 void LoadablePluginPlaceholder::MarkPluginEssential(
80 PluginInstanceThrottler::PowerSaverUnthrottleMethod method) { 82 PluginInstanceThrottler::PowerSaverUnthrottleMethod method) {
81 if (!power_saver_enabled_) 83 if (!power_saver_enabled_)
82 return; 84 return;
83 85
84 power_saver_enabled_ = false; 86 power_saver_enabled_ = false;
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 return identifier_; 366 return identifier_;
365 } 367 }
366 368
367 bool LoadablePluginPlaceholder::LoadingBlocked() const { 369 bool LoadablePluginPlaceholder::LoadingBlocked() const {
368 DCHECK(allow_loading_); 370 DCHECK(allow_loading_);
369 return is_blocked_for_tinyness_ || is_blocked_for_background_tab_ || 371 return is_blocked_for_tinyness_ || is_blocked_for_background_tab_ ||
370 is_blocked_for_power_saver_poster_ || is_blocked_for_prerendering_; 372 is_blocked_for_power_saver_poster_ || is_blocked_for_prerendering_;
371 } 373 }
372 374
373 } // namespace plugins 375 } // namespace plugins
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/plugins/object-onerror-placeholder.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698