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 "components/html_viewer/blink_platform_impl.h" | 5 #include "components/html_viewer/blink_platform_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
12 #include "base/synchronization/waitable_event.h" | 12 #include "base/synchronization/waitable_event.h" |
13 #include "base/thread_task_runner_handle.h" | 13 #include "base/thread_task_runner_handle.h" |
14 #include "base/threading/platform_thread.h" | 14 #include "base/threading/platform_thread.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "base/trace_event/trace_event.h" |
16 #include "components/html_viewer/blink_resource_constants.h" | 17 #include "components/html_viewer/blink_resource_constants.h" |
17 #include "components/html_viewer/web_clipboard_impl.h" | 18 #include "components/html_viewer/web_clipboard_impl.h" |
18 #include "components/html_viewer/web_cookie_jar_impl.h" | 19 #include "components/html_viewer/web_cookie_jar_impl.h" |
19 #include "components/html_viewer/web_socket_handle_impl.h" | 20 #include "components/html_viewer/web_socket_handle_impl.h" |
20 #include "components/html_viewer/web_url_loader_impl.h" | 21 #include "components/html_viewer/web_url_loader_impl.h" |
21 #include "components/message_port/web_message_port_channel_impl.h" | 22 #include "components/message_port/web_message_port_channel_impl.h" |
22 #include "components/mime_util/mime_util.h" | 23 #include "components/mime_util/mime_util.h" |
23 #include "components/scheduler/child/webthread_impl_for_worker_scheduler.h" | 24 #include "components/scheduler/child/webthread_impl_for_worker_scheduler.h" |
24 #include "components/scheduler/renderer/renderer_scheduler.h" | 25 #include "components/scheduler/renderer/renderer_scheduler.h" |
25 #include "components/scheduler/renderer/webthread_impl_for_renderer_scheduler.h" | 26 #include "components/scheduler/renderer/webthread_impl_for_renderer_scheduler.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 } | 127 } |
127 | 128 |
128 bool BlinkPlatformImpl::isThreadedCompositingEnabled() { | 129 bool BlinkPlatformImpl::isThreadedCompositingEnabled() { |
129 return true; | 130 return true; |
130 } | 131 } |
131 | 132 |
132 blink::WebCompositorSupport* BlinkPlatformImpl::compositorSupport() { | 133 blink::WebCompositorSupport* BlinkPlatformImpl::compositorSupport() { |
133 return &compositor_support_; | 134 return &compositor_support_; |
134 } | 135 } |
135 | 136 |
| 137 uint32_t BlinkPlatformImpl::getUniqueIdForProcess() { |
| 138 // TODO(rickyz): Replace this with base::GetUniqueIdForProcess when that's |
| 139 // ready. |
| 140 return base::trace_event::TraceLog::GetInstance()->process_id(); |
| 141 } |
| 142 |
136 void BlinkPlatformImpl::createMessageChannel( | 143 void BlinkPlatformImpl::createMessageChannel( |
137 blink::WebMessagePortChannel** channel1, | 144 blink::WebMessagePortChannel** channel1, |
138 blink::WebMessagePortChannel** channel2) { | 145 blink::WebMessagePortChannel** channel2) { |
139 message_port::WebMessagePortChannelImpl::CreatePair(channel1, channel2); | 146 message_port::WebMessagePortChannelImpl::CreatePair(channel1, channel2); |
140 } | 147 } |
141 | 148 |
142 blink::WebScrollbarBehavior* BlinkPlatformImpl::scrollbarBehavior() { | 149 blink::WebScrollbarBehavior* BlinkPlatformImpl::scrollbarBehavior() { |
143 return &scrollbar_behavior_; | 150 return &scrollbar_behavior_; |
144 } | 151 } |
145 | 152 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 BlinkPlatformImpl::notificationManager() { | 273 BlinkPlatformImpl::notificationManager() { |
267 return &web_notification_manager_; | 274 return &web_notification_manager_; |
268 } | 275 } |
269 | 276 |
270 void BlinkPlatformImpl::UpdateWebThreadTLS(blink::WebThread* thread) { | 277 void BlinkPlatformImpl::UpdateWebThreadTLS(blink::WebThread* thread) { |
271 DCHECK(!current_thread_slot_.Get()); | 278 DCHECK(!current_thread_slot_.Get()); |
272 current_thread_slot_.Set(thread); | 279 current_thread_slot_.Set(thread); |
273 } | 280 } |
274 | 281 |
275 } // namespace html_viewer | 282 } // namespace html_viewer |
OLD | NEW |