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/ppapi_plugin/ppapi_thread.h" | 5 #include "content/ppapi_plugin/ppapi_thread.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/cpu.h" | 12 #include "base/cpu.h" |
13 #include "base/debug/alias.h" | 13 #include "base/debug/alias.h" |
14 #include "base/debug/crash_logging.h" | 14 #include "base/debug/crash_logging.h" |
15 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "base/memory/discardable_memory_allocator.h" | 17 #include "base/memory/discardable_memory_allocator.h" |
18 #include "base/metrics/histogram.h" | 18 #include "base/metrics/histogram.h" |
19 #include "base/metrics/sparse_histogram.h" | 19 #include "base/metrics/sparse_histogram.h" |
20 #include "base/rand_util.h" | 20 #include "base/rand_util.h" |
| 21 #include "base/single_thread_task_runner.h" |
21 #include "base/strings/stringprintf.h" | 22 #include "base/strings/stringprintf.h" |
22 #include "base/strings/utf_string_conversions.h" | 23 #include "base/strings/utf_string_conversions.h" |
23 #include "base/threading/platform_thread.h" | 24 #include "base/threading/platform_thread.h" |
24 #include "base/time/time.h" | 25 #include "base/time/time.h" |
25 #include "base/trace_event/trace_event.h" | 26 #include "base/trace_event/trace_event.h" |
26 #include "build/build_config.h" | 27 #include "build/build_config.h" |
27 #include "content/child/browser_font_resource_trusted.h" | 28 #include "content/child/browser_font_resource_trusted.h" |
28 #include "content/child/child_discardable_shared_memory_manager.h" | 29 #include "content/child/child_discardable_shared_memory_manager.h" |
29 #include "content/child/child_process.h" | 30 #include "content/child/child_process.h" |
30 #include "content/common/child_process_messages.h" | 31 #include "content/common/child_process_messages.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 143 |
143 ppapi::proxy::PluginGlobals::Get()->ResetPluginProxyDelegate(); | 144 ppapi::proxy::PluginGlobals::Get()->ResetPluginProxyDelegate(); |
144 if (plugin_entry_points_.shutdown_module) | 145 if (plugin_entry_points_.shutdown_module) |
145 plugin_entry_points_.shutdown_module(); | 146 plugin_entry_points_.shutdown_module(); |
146 blink_platform_impl_->Shutdown(); | 147 blink_platform_impl_->Shutdown(); |
147 blink::Platform::shutdown(); | 148 blink::Platform::shutdown(); |
148 } | 149 } |
149 | 150 |
150 bool PpapiThread::Send(IPC::Message* msg) { | 151 bool PpapiThread::Send(IPC::Message* msg) { |
151 // Allow access from multiple threads. | 152 // Allow access from multiple threads. |
152 if (base::MessageLoop::current() == message_loop()) | 153 if (message_loop()->task_runner()->BelongsToCurrentThread()) |
153 return ChildThreadImpl::Send(msg); | 154 return ChildThreadImpl::Send(msg); |
154 | 155 |
155 return sync_message_filter()->Send(msg); | 156 return sync_message_filter()->Send(msg); |
156 } | 157 } |
157 | 158 |
158 // Note that this function is called only for messages from the channel to the | 159 // Note that this function is called only for messages from the channel to the |
159 // browser process. Messages from the renderer process are sent via a different | 160 // browser process. Messages from the renderer process are sent via a different |
160 // channel that ends up at Dispatcher::OnMessageReceived. | 161 // channel that ends up at Dispatcher::OnMessageReceived. |
161 bool PpapiThread::OnControlMessageReceived(const IPC::Message& msg) { | 162 bool PpapiThread::OnControlMessageReceived(const IPC::Message& msg) { |
162 bool handled = true; | 163 bool handled = true; |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 GetHistogramName(is_broker_, "LoadTime", path), | 588 GetHistogramName(is_broker_, "LoadTime", path), |
588 base::TimeDelta::FromMilliseconds(1), | 589 base::TimeDelta::FromMilliseconds(1), |
589 base::TimeDelta::FromSeconds(10), | 590 base::TimeDelta::FromSeconds(10), |
590 50, | 591 50, |
591 base::HistogramBase::kUmaTargetedHistogramFlag); | 592 base::HistogramBase::kUmaTargetedHistogramFlag); |
592 | 593 |
593 histogram->AddTime(load_time); | 594 histogram->AddTime(load_time); |
594 } | 595 } |
595 | 596 |
596 } // namespace content | 597 } // namespace content |
OLD | NEW |