| 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/renderer/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNetworkStateNotifi
er.h" | 72 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNetworkStateNotifi
er.h" |
| 73 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenu.h" | 73 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenu.h" |
| 74 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" | 74 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" |
| 75 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h
" | 75 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h
" |
| 76 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" | 76 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" |
| 77 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat
cher.h" | 77 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat
cher.h" |
| 78 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 78 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
| 79 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 79 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 80 #include "ui/base/ui_base_switches.h" | 80 #include "ui/base/ui_base_switches.h" |
| 81 #include "v8/include/v8.h" | 81 #include "v8/include/v8.h" |
| 82 #include "webkit/extensions/v8/playback_extension.h" | |
| 83 #include "webkit/glue/webkit_glue.h" | 82 #include "webkit/glue/webkit_glue.h" |
| 84 | 83 |
| 85 // TODO(port) | 84 // TODO(port) |
| 86 #if !defined(OS_WIN) | 85 #if !defined(OS_WIN) |
| 87 #include "base/memory/scoped_handle.h" | 86 #include "base/memory/scoped_handle.h" |
| 88 #include "content/common/np_channel_base.h" | 87 #include "content/common/np_channel_base.h" |
| 89 #endif | 88 #endif |
| 90 | 89 |
| 91 #if defined(OS_WIN) | 90 #if defined(OS_WIN) |
| 92 #include <windows.h> | 91 #include <windows.h> |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 | 475 |
| 477 WebScriptController::enableV8SingleThreadMode(); | 476 WebScriptController::enableV8SingleThreadMode(); |
| 478 | 477 |
| 479 RenderThreadImpl::RegisterSchemes(); | 478 RenderThreadImpl::RegisterSchemes(); |
| 480 | 479 |
| 481 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 480 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 482 | 481 |
| 483 webkit_glue::EnableWebCoreLogChannels( | 482 webkit_glue::EnableWebCoreLogChannels( |
| 484 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels)); | 483 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels)); |
| 485 | 484 |
| 486 if (command_line.HasSwitch(switches::kPlaybackMode) || | |
| 487 command_line.HasSwitch(switches::kRecordMode) || | |
| 488 command_line.HasSwitch(switches::kNoJsRandomness)) { | |
| 489 RegisterExtension(extensions_v8::PlaybackExtension::Get()); | |
| 490 } | |
| 491 | |
| 492 if (CommandLine::ForCurrentProcess()->HasSwitch( | 485 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 493 switches::kDomAutomationController)) { | 486 switches::kDomAutomationController)) { |
| 494 base::StringPiece extension = content::GetContentClient()->GetDataResource( | 487 base::StringPiece extension = content::GetContentClient()->GetDataResource( |
| 495 IDR_DOM_AUTOMATION_JS); | 488 IDR_DOM_AUTOMATION_JS); |
| 496 RegisterExtension(new v8::Extension( | 489 RegisterExtension(new v8::Extension( |
| 497 "dom_automation.js", extension.data(), 0, NULL, extension.size())); | 490 "dom_automation.js", extension.data(), 0, NULL, extension.size())); |
| 498 } | 491 } |
| 499 | 492 |
| 500 web_database_observer_impl_.reset( | 493 web_database_observer_impl_.reset( |
| 501 new WebDatabaseObserverImpl(sync_message_filter())); | 494 new WebDatabaseObserverImpl(sync_message_filter())); |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 | 975 |
| 983 scoped_refptr<base::MessageLoopProxy> | 976 scoped_refptr<base::MessageLoopProxy> |
| 984 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 977 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
| 985 DCHECK(message_loop() == MessageLoop::current()); | 978 DCHECK(message_loop() == MessageLoop::current()); |
| 986 if (!file_thread_.get()) { | 979 if (!file_thread_.get()) { |
| 987 file_thread_.reset(new base::Thread("Renderer::FILE")); | 980 file_thread_.reset(new base::Thread("Renderer::FILE")); |
| 988 file_thread_->Start(); | 981 file_thread_->Start(); |
| 989 } | 982 } |
| 990 return file_thread_->message_loop_proxy(); | 983 return file_thread_->message_loop_proxy(); |
| 991 } | 984 } |
| OLD | NEW |