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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 975533002: Move didClearWindowObject to RenderFrame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | content/renderer/render_view_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 435abdf9d8fee809f5d33475006fa9bf63362cf1..1880edd348b279b6fb4d801ce6cc11a5deb95f77 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -19,6 +19,7 @@
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
+#include "cc/base/switches.h"
#include "content/child/appcache/appcache_dispatcher.h"
#include "content/child/plugin_messages.h"
#include "content/child/quota_dispatcher.h"
@@ -65,6 +66,7 @@
#include "content/renderer/dom_utils.h"
#include "content/renderer/external_popup_menu.h"
#include "content/renderer/geolocation_dispatcher.h"
+#include "content/renderer/gpu/gpu_benchmarking_extension.h"
#include "content/renderer/history_controller.h"
#include "content/renderer/history_serialization.h"
#include "content/renderer/image_loading_helper.h"
@@ -80,6 +82,7 @@
#include "content/renderer/media/render_media_log.h"
#include "content/renderer/media/user_media_client_impl.h"
#include "content/renderer/media/webmediaplayer_ms.h"
+#include "content/renderer/memory_benchmarking_extension.h"
#include "content/renderer/mojo/service_registry_js_wrapper.h"
#include "content/renderer/notification_permission_dispatcher.h"
#include "content/renderer/npapi/plugin_channel_host.h"
@@ -95,6 +98,9 @@
#include "content/renderer/renderer_webcolorchooser_impl.h"
#include "content/renderer/screen_orientation/screen_orientation_dispatcher.h"
#include "content/renderer/shared_worker_repository.h"
+#include "content/renderer/skia_benchmarking_extension.h"
+#include "content/renderer/stats_collection_controller.h"
+#include "content/renderer/web_ui_extension.h"
#include "content/renderer/websharedworker_proxy.h"
#include "gin/modules/module_registry.h"
#include "media/base/audio_renderer_mixer_input.h"
@@ -2557,16 +2563,32 @@ void RenderFrameImpl::didCreateNewDocument(blink::WebLocalFrame* frame) {
void RenderFrameImpl::didClearWindowObject(blink::WebLocalFrame* frame) {
DCHECK(!frame_ || frame_ == frame);
- // TODO(nasko): Move implementation here. Needed state:
- // * enabled_bindings_
- // * dom_automation_controller_
- // * stats_collection_controller_
- render_view_->didClearWindowObject(frame);
+ int enabled_bindings = render_view_->GetEnabledBindings();
+
+ if (enabled_bindings & BINDINGS_POLICY_WEB_UI)
+ WebUIExtension::Install(frame);
- if (render_view_->GetEnabledBindings() & BINDINGS_POLICY_DOM_AUTOMATION)
+ if (enabled_bindings & BINDINGS_POLICY_DOM_AUTOMATION)
DomAutomationController::Install(this, frame);
+ if (enabled_bindings & BINDINGS_POLICY_STATS_COLLECTION)
+ StatsCollectionController::Install(frame);
+
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
+
+ if (command_line.HasSwitch(cc::switches::kEnableGpuBenchmarking))
+ GpuBenchmarking::Install(frame);
+
+ if (command_line.HasSwitch(switches::kEnableMemoryBenchmarking))
+ MemoryBenchmarkingExtension::Install(frame);
+
+ if (command_line.HasSwitch(switches::kEnableSkiaBenchmarking))
+ SkiaBenchmarking::Install(frame);
+
+ FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(),
nasko 2015/03/02 23:06:37 Shouldn't this be moved to be the first code in th
+ DidClearWindowObject(frame));
FOR_EACH_OBSERVER(RenderFrameObserver, observers_, DidClearWindowObject());
}
« no previous file with comments | « no previous file | content/renderer/render_view_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698