| OLD | NEW |
| 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/shell/shell_render_process_observer.h" | 5 #include "content/shell/shell_render_process_observer.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "content/public/renderer/render_thread.h" | 8 #include "content/public/renderer/render_thread.h" |
| 9 #include "content/shell/layout_test_controller_bindings.h" | 9 #include "content/shell/layout_test_controller_bindings.h" |
| 10 #include "content/shell/shell_switches.h" | 10 #include "content/shell/shell_switches.h" |
| 11 #include "webkit/glue/webkit_glue.h" |
| 12 #include "webkit/support/gc_extension.h" |
| 11 | 13 |
| 12 namespace content { | 14 namespace content { |
| 13 | 15 |
| 14 ShellRenderProcessObserver::ShellRenderProcessObserver() { | 16 ShellRenderProcessObserver::ShellRenderProcessObserver() { |
| 15 RenderThread::Get()->AddObserver(this); | 17 RenderThread::Get()->AddObserver(this); |
| 16 } | 18 } |
| 17 | 19 |
| 18 ShellRenderProcessObserver::~ShellRenderProcessObserver() { | 20 ShellRenderProcessObserver::~ShellRenderProcessObserver() { |
| 19 } | 21 } |
| 20 | 22 |
| 21 void ShellRenderProcessObserver::WebKitInitialized() { | 23 void ShellRenderProcessObserver::WebKitInitialized() { |
| 22 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | 24 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
| 23 RenderThread::Get()->RegisterExtension(new LayoutTestControllerBindings()); | 25 return; |
| 26 |
| 27 // To implement a catch-all for not yet implemented controller properties. |
| 28 webkit_glue::SetJavaScriptFlags(" --harmony_proxies"); |
| 29 RenderThread::Get()->RegisterExtension(new LayoutTestControllerBindings()); |
| 30 |
| 31 // We always expose GC to layout tests. |
| 32 webkit_glue::SetJavaScriptFlags(" --expose-gc"); |
| 33 RenderThread::Get()->RegisterExtension(extensions_v8::GCExtension::Get()); |
| 24 } | 34 } |
| 25 | 35 |
| 26 } // namespace content | 36 } // namespace content |
| OLD | NEW |