OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/renderer/dispatcher.h" | 5 #include "extensions/renderer/dispatcher.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/alias.h" | 10 #include "base/debug/alias.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 176 |
177 } // namespace | 177 } // namespace |
178 | 178 |
179 Dispatcher::Dispatcher(DispatcherDelegate* delegate) | 179 Dispatcher::Dispatcher(DispatcherDelegate* delegate) |
180 : delegate_(delegate), | 180 : delegate_(delegate), |
181 content_watcher_(new ContentWatcher()), | 181 content_watcher_(new ContentWatcher()), |
182 source_map_(&ResourceBundle::GetSharedInstance()), | 182 source_map_(&ResourceBundle::GetSharedInstance()), |
183 v8_schema_registry_(new V8SchemaRegistry), | 183 v8_schema_registry_(new V8SchemaRegistry), |
184 is_webkit_initialized_(false), | 184 is_webkit_initialized_(false), |
185 user_script_set_manager_observer_(this) { | 185 user_script_set_manager_observer_(this) { |
186 const CommandLine& command_line = *(CommandLine::ForCurrentProcess()); | 186 CommandLine& command_line = *(CommandLine::ForCurrentProcess()); |
187 is_extension_process_ = | 187 is_extension_process_ = |
188 command_line.HasSwitch(extensions::switches::kExtensionProcess) || | 188 command_line.HasSwitch(extensions::switches::kExtensionProcess) || |
189 command_line.HasSwitch(::switches::kSingleProcess); | 189 command_line.HasSwitch(::switches::kSingleProcess); |
190 | 190 |
191 if (is_extension_process_) { | 191 if (is_extension_process_) { |
192 RenderThread::Get()->SetIdleNotificationDelayInMs( | 192 RenderThread::Get()->SetIdleNotificationDelayInMs( |
193 kInitialExtensionIdleHandlerDelayMs); | 193 kInitialExtensionIdleHandlerDelayMs); |
| 194 command_line.AppendSwitch(::switches::kEnableWebRtcHWH264Encoding); |
194 } | 195 } |
195 | 196 |
196 RenderThread::Get()->RegisterExtension(SafeBuiltins::CreateV8Extension()); | 197 RenderThread::Get()->RegisterExtension(SafeBuiltins::CreateV8Extension()); |
197 | 198 |
198 user_script_set_manager_.reset(new UserScriptSetManager(&extensions_)); | 199 user_script_set_manager_.reset(new UserScriptSetManager(&extensions_)); |
199 script_injection_manager_.reset( | 200 script_injection_manager_.reset( |
200 new ScriptInjectionManager(&extensions_, user_script_set_manager_.get())); | 201 new ScriptInjectionManager(&extensions_, user_script_set_manager_.get())); |
201 user_script_set_manager_observer_.Add(user_script_set_manager_.get()); | 202 user_script_set_manager_observer_.Add(user_script_set_manager_.get()); |
202 request_sender_.reset(new RequestSender(this)); | 203 request_sender_.reset(new RequestSender(this)); |
203 PopulateSourceMap(); | 204 PopulateSourceMap(); |
(...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1291 return v8::Handle<v8::Object>(); | 1292 return v8::Handle<v8::Object>(); |
1292 | 1293 |
1293 if (bind_name) | 1294 if (bind_name) |
1294 *bind_name = split.back(); | 1295 *bind_name = split.back(); |
1295 | 1296 |
1296 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) | 1297 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) |
1297 : bind_object; | 1298 : bind_object; |
1298 } | 1299 } |
1299 | 1300 |
1300 } // namespace extensions | 1301 } // namespace extensions |
OLD | NEW |