Chromium Code Reviews| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 #else | 139 #else |
| 140 // TODO(port) | 140 // TODO(port) |
| 141 #include "base/memory/scoped_handle.h" | 141 #include "base/memory/scoped_handle.h" |
| 142 #include "content/child/npapi/np_channel_base.h" | 142 #include "content/child/npapi/np_channel_base.h" |
| 143 #endif | 143 #endif |
| 144 | 144 |
| 145 #if defined(ENABLE_PLUGINS) | 145 #if defined(ENABLE_PLUGINS) |
| 146 #include "content/renderer/npapi/plugin_channel_host.h" | 146 #include "content/renderer/npapi/plugin_channel_host.h" |
| 147 #endif | 147 #endif |
| 148 | 148 |
| 149 // TODO(sky): remove ifdef, temporary until mac/android sorted out. | |
| 150 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) | |
| 151 #include "content/renderer/mojo_message_filter.h" | |
| 152 #endif | |
| 153 | |
| 149 using base::ThreadRestrictions; | 154 using base::ThreadRestrictions; |
| 150 using blink::WebDocument; | 155 using blink::WebDocument; |
| 151 using blink::WebFrame; | 156 using blink::WebFrame; |
| 152 using blink::WebNetworkStateNotifier; | 157 using blink::WebNetworkStateNotifier; |
| 153 using blink::WebRuntimeFeatures; | 158 using blink::WebRuntimeFeatures; |
| 154 using blink::WebScriptController; | 159 using blink::WebScriptController; |
| 155 using blink::WebSecurityPolicy; | 160 using blink::WebSecurityPolicy; |
| 156 using blink::WebString; | 161 using blink::WebString; |
| 157 using blink::WebView; | 162 using blink::WebView; |
| 158 | 163 |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 379 audio_message_filter_ = new AudioMessageFilter(GetIOMessageLoopProxy()); | 384 audio_message_filter_ = new AudioMessageFilter(GetIOMessageLoopProxy()); |
| 380 AddFilter(audio_message_filter_.get()); | 385 AddFilter(audio_message_filter_.get()); |
| 381 | 386 |
| 382 midi_message_filter_ = new MidiMessageFilter(GetIOMessageLoopProxy()); | 387 midi_message_filter_ = new MidiMessageFilter(GetIOMessageLoopProxy()); |
| 383 AddFilter(midi_message_filter_.get()); | 388 AddFilter(midi_message_filter_.get()); |
| 384 | 389 |
| 385 AddFilter((new IndexedDBMessageFilter(thread_safe_sender()))->GetFilter()); | 390 AddFilter((new IndexedDBMessageFilter(thread_safe_sender()))->GetFilter()); |
| 386 | 391 |
| 387 AddFilter((new EmbeddedWorkerContextMessageFilter())->GetFilter()); | 392 AddFilter((new EmbeddedWorkerContextMessageFilter())->GetFilter()); |
| 388 | 393 |
| 394 // TODO(sky): remove ifdef, temporary until mac/android sorted out. | |
| 395 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) | |
| 396 // MojoMessageFilter deletes itself as necessary. | |
|
Tom Sepez
2014/03/13 23:05:36
nit: can we avoid this pattern and use AddFilter i
sky
2014/03/13 23:10:50
I actually did this first, then pulled out my hair
| |
| 397 new MojoMessageFilter(this); | |
| 398 #endif | |
| 399 | |
| 389 GetContentClient()->renderer()->RenderThreadStarted(); | 400 GetContentClient()->renderer()->RenderThreadStarted(); |
| 390 | 401 |
| 391 InitSkiaEventTracer(); | 402 InitSkiaEventTracer(); |
| 392 | 403 |
| 393 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 404 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 394 if (command_line.HasSwitch(cc::switches::kEnableGpuBenchmarking)) | 405 if (command_line.HasSwitch(cc::switches::kEnableGpuBenchmarking)) |
| 395 RegisterExtension(GpuBenchmarkingExtension::Get()); | 406 RegisterExtension(GpuBenchmarkingExtension::Get()); |
| 396 | 407 |
| 397 is_impl_side_painting_enabled_ = | 408 is_impl_side_painting_enabled_ = |
| 398 command_line.HasSwitch(switches::kEnableImplSidePainting) && | 409 command_line.HasSwitch(switches::kEnableImplSidePainting) && |
| (...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1468 hidden_widget_count_--; | 1479 hidden_widget_count_--; |
| 1469 | 1480 |
| 1470 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { | 1481 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { |
| 1471 return; | 1482 return; |
| 1472 } | 1483 } |
| 1473 | 1484 |
| 1474 ScheduleIdleHandler(kLongIdleHandlerDelayMs); | 1485 ScheduleIdleHandler(kLongIdleHandlerDelayMs); |
| 1475 } | 1486 } |
| 1476 | 1487 |
| 1477 } // namespace content | 1488 } // namespace content |
| OLD | NEW |