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

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

Issue 2566583002: Change allowed bindings to be per RenderFrame instead of per RenderView. (Closed)
Patch Set: Created 3 years, 11 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 "content/renderer/render_process_impl.h" 5 #include "content/renderer/render_process_impl.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include <windows.h> 10 #include <windows.h>
(...skipping 11 matching lines...) Expand all
22 #include "base/debug/crash_logging.h" 22 #include "base/debug/crash_logging.h"
23 #include "base/feature_list.h" 23 #include "base/feature_list.h"
24 #include "base/sys_info.h" 24 #include "base/sys_info.h"
25 #include "base/task_scheduler/initialization_util.h" 25 #include "base/task_scheduler/initialization_util.h"
26 #include "base/task_scheduler/scheduler_worker_pool_params.h" 26 #include "base/task_scheduler/scheduler_worker_pool_params.h"
27 #include "base/task_scheduler/task_scheduler.h" 27 #include "base/task_scheduler/task_scheduler.h"
28 #include "base/task_scheduler/task_traits.h" 28 #include "base/task_scheduler/task_traits.h"
29 #include "base/threading/platform_thread.h" 29 #include "base/threading/platform_thread.h"
30 #include "base/time/time.h" 30 #include "base/time/time.h"
31 #include "content/child/site_isolation_stats_gatherer.h" 31 #include "content/child/site_isolation_stats_gatherer.h"
32 #include "content/public/common/bindings_policy.h"
32 #include "content/public/common/content_client.h" 33 #include "content/public/common/content_client.h"
33 #include "content/public/common/content_features.h" 34 #include "content/public/common/content_features.h"
34 #include "content/public/common/content_switches.h" 35 #include "content/public/common/content_switches.h"
35 #include "content/public/renderer/content_renderer_client.h" 36 #include "content/public/renderer/content_renderer_client.h"
36 #include "third_party/WebKit/public/web/WebFrame.h" 37 #include "third_party/WebKit/public/web/WebFrame.h"
37 #include "v8/include/v8.h" 38 #include "v8/include/v8.h"
38 39
39 #if defined(OS_WIN) 40 #if defined(OS_WIN)
40 #include "base/win/win_util.h" 41 #include "base/win/win_util.h"
41 #endif 42 #endif
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 *base::CommandLine::ForCurrentProcess(); 180 *base::CommandLine::ForCurrentProcess();
180 181
181 if (command_line.HasSwitch(switches::kJavaScriptFlags)) { 182 if (command_line.HasSwitch(switches::kJavaScriptFlags)) {
182 std::string flags( 183 std::string flags(
183 command_line.GetSwitchValueASCII(switches::kJavaScriptFlags)); 184 command_line.GetSwitchValueASCII(switches::kJavaScriptFlags));
184 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size())); 185 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size()));
185 } 186 }
186 187
187 SiteIsolationStatsGatherer::SetEnabled( 188 SiteIsolationStatsGatherer::SetEnabled(
188 GetContentClient()->renderer()->ShouldGatherSiteIsolationStats()); 189 GetContentClient()->renderer()->ShouldGatherSiteIsolationStats());
190
191 if (command_line.HasSwitch(switches::kDomAutomationController))
192 enabled_bindings_ |= BINDINGS_POLICY_DOM_AUTOMATION;
193 if (command_line.HasSwitch(switches::kStatsCollectionController))
194 enabled_bindings_ |= BINDINGS_POLICY_STATS_COLLECTION;
189 } 195 }
190 196
191 RenderProcessImpl::~RenderProcessImpl() { 197 RenderProcessImpl::~RenderProcessImpl() {
192 #ifndef NDEBUG 198 #ifndef NDEBUG
193 int count = blink::WebFrame::instanceCount(); 199 int count = blink::WebFrame::instanceCount();
194 if (count) 200 if (count)
195 DLOG(ERROR) << "WebFrame LEAKED " << count << " TIMES"; 201 DLOG(ERROR) << "WebFrame LEAKED " << count << " TIMES";
196 #endif 202 #endif
197 203
198 GetShutDownEvent()->Signal(); 204 GetShutDownEvent()->Signal();
(...skipping 19 matching lines...) Expand all
218 index_to_traits_callback = 224 index_to_traits_callback =
219 base::Bind(&DefaultRendererWorkerPoolIndexForTraits); 225 base::Bind(&DefaultRendererWorkerPoolIndexForTraits);
220 } 226 }
221 DCHECK(index_to_traits_callback); 227 DCHECK(index_to_traits_callback);
222 228
223 base::TaskScheduler::CreateAndSetDefaultTaskScheduler( 229 base::TaskScheduler::CreateAndSetDefaultTaskScheduler(
224 params_vector, index_to_traits_callback); 230 params_vector, index_to_traits_callback);
225 } 231 }
226 232
227 } // namespace content 233 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698