| 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 "sky/viewer/platform/platform_impl.h" | 5 #include "sky/viewer/platform/platform_impl.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 private: | 34 private: |
| 35 virtual ~ConvertableToTraceFormatWrapper() {} | 35 virtual ~ConvertableToTraceFormatWrapper() {} |
| 36 | 36 |
| 37 blink::WebConvertableToTraceFormat convertable_; | 37 blink::WebConvertableToTraceFormat convertable_; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 } // namespace | 40 } // namespace |
| 41 | 41 |
| 42 PlatformImpl::PlatformImpl(mojo::ApplicationImpl* app) | 42 PlatformImpl::PlatformImpl(mojo::ApplicationImpl* app) |
| 43 : main_loop_(base::MessageLoop::current()), | 43 : main_loop_(base::MessageLoop::current()), |
| 44 main_thread_task_runner_(base::MessageLoop::current()->task_runner()), |
| 44 shared_timer_func_(NULL), | 45 shared_timer_func_(NULL), |
| 45 shared_timer_fire_time_(0.0), | 46 shared_timer_fire_time_(0.0), |
| 46 shared_timer_fire_time_was_set_while_suspended_(false), | 47 shared_timer_fire_time_was_set_while_suspended_(false), |
| 47 shared_timer_suspended_(0) { | 48 shared_timer_suspended_(0) { |
| 48 app->ConnectToService("mojo://network_service/", &network_service_); | 49 app->ConnectToService("mojo://network_service/", &network_service_); |
| 49 | 50 |
| 50 mojo::CookieStorePtr cookie_store; | 51 mojo::CookieStorePtr cookie_store; |
| 51 network_service_->GetCookieStore(GetProxy(&cookie_store)); | 52 network_service_->GetCookieStore(GetProxy(&cookie_store)); |
| 52 } | 53 } |
| 53 | 54 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 117 |
| 117 void PlatformImpl::stopSharedTimer() { | 118 void PlatformImpl::stopSharedTimer() { |
| 118 shared_timer_.Stop(); | 119 shared_timer_.Stop(); |
| 119 } | 120 } |
| 120 | 121 |
| 121 void PlatformImpl::callOnMainThread( | 122 void PlatformImpl::callOnMainThread( |
| 122 void (*func)(void*), void* context) { | 123 void (*func)(void*), void* context) { |
| 123 main_loop_->PostTask(FROM_HERE, base::Bind(func, context)); | 124 main_loop_->PostTask(FROM_HERE, base::Bind(func, context)); |
| 124 } | 125 } |
| 125 | 126 |
| 127 base::SingleThreadTaskRunner* PlatformImpl::mainThreadTaskRunner() { |
| 128 return main_thread_task_runner_.get(); |
| 129 } |
| 130 |
| 131 |
| 126 bool PlatformImpl::isThreadedCompositingEnabled() { | 132 bool PlatformImpl::isThreadedCompositingEnabled() { |
| 127 return true; | 133 return true; |
| 128 } | 134 } |
| 129 | 135 |
| 130 blink::WebCompositorSupport* PlatformImpl::compositorSupport() { | 136 blink::WebCompositorSupport* PlatformImpl::compositorSupport() { |
| 131 return &compositor_support_; | 137 return &compositor_support_; |
| 132 } | 138 } |
| 133 | 139 |
| 134 blink::WebScrollbarBehavior* PlatformImpl::scrollbarBehavior() { | 140 blink::WebScrollbarBehavior* PlatformImpl::scrollbarBehavior() { |
| 135 return &scrollbar_behavior_; | 141 return &scrollbar_behavior_; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 const unsigned char* category_group_enabled, | 258 const unsigned char* category_group_enabled, |
| 253 const char* name, | 259 const char* name, |
| 254 TraceEventHandle handle) { | 260 TraceEventHandle handle) { |
| 255 base::debug::TraceEventHandle traceEventHandle; | 261 base::debug::TraceEventHandle traceEventHandle; |
| 256 memcpy(&traceEventHandle, &handle, sizeof(handle)); | 262 memcpy(&traceEventHandle, &handle, sizeof(handle)); |
| 257 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION( | 263 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION( |
| 258 category_group_enabled, name, traceEventHandle); | 264 category_group_enabled, name, traceEventHandle); |
| 259 } | 265 } |
| 260 | 266 |
| 261 } // namespace sky | 267 } // namespace sky |
| OLD | NEW |