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 "mojo/services/html_viewer/blink_platform_impl.h" | 5 #include "mojo/services/html_viewer/blink_platform_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 }; | 44 }; |
45 | 45 |
46 } // namespace | 46 } // namespace |
47 | 47 |
48 BlinkPlatformImpl::BlinkPlatformImpl() | 48 BlinkPlatformImpl::BlinkPlatformImpl() |
49 : main_loop_(base::MessageLoop::current()), | 49 : main_loop_(base::MessageLoop::current()), |
50 shared_timer_func_(NULL), | 50 shared_timer_func_(NULL), |
51 shared_timer_fire_time_(0.0), | 51 shared_timer_fire_time_(0.0), |
52 shared_timer_fire_time_was_set_while_suspended_(false), | 52 shared_timer_fire_time_was_set_while_suspended_(false), |
53 shared_timer_suspended_(0), | 53 shared_timer_suspended_(0), |
54 current_thread_slot_(&DestroyCurrentThread) { | 54 current_thread_slot_(&DestroyCurrentThread), |
| 55 scheduler_(main_loop_->message_loop_proxy()) { |
55 } | 56 } |
56 | 57 |
57 BlinkPlatformImpl::~BlinkPlatformImpl() { | 58 BlinkPlatformImpl::~BlinkPlatformImpl() { |
58 } | 59 } |
59 | 60 |
60 blink::WebMimeRegistry* BlinkPlatformImpl::mimeRegistry() { | 61 blink::WebMimeRegistry* BlinkPlatformImpl::mimeRegistry() { |
61 return &mime_registry_; | 62 return &mime_registry_; |
62 } | 63 } |
63 | 64 |
64 blink::WebThemeEngine* BlinkPlatformImpl::themeEngine() { | 65 blink::WebThemeEngine* BlinkPlatformImpl::themeEngine() { |
65 return &theme_engine_; | 66 return &theme_engine_; |
66 } | 67 } |
67 | 68 |
| 69 blink::WebScheduler* BlinkPlatformImpl::scheduler() { |
| 70 return &scheduler_; |
| 71 } |
| 72 |
68 blink::WebString BlinkPlatformImpl::defaultLocale() { | 73 blink::WebString BlinkPlatformImpl::defaultLocale() { |
69 return blink::WebString::fromUTF8("en-US"); | 74 return blink::WebString::fromUTF8("en-US"); |
70 } | 75 } |
71 | 76 |
72 double BlinkPlatformImpl::currentTime() { | 77 double BlinkPlatformImpl::currentTime() { |
73 return base::Time::Now().ToDoubleT(); | 78 return base::Time::Now().ToDoubleT(); |
74 } | 79 } |
75 | 80 |
76 double BlinkPlatformImpl::monotonicallyIncreasingTime() { | 81 double BlinkPlatformImpl::monotonicallyIncreasingTime() { |
77 return base::TimeTicks::Now().ToInternalValue() / | 82 return base::TimeTicks::Now().ToInternalValue() / |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 } | 240 } |
236 | 241 |
237 // static | 242 // static |
238 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { | 243 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { |
239 WebThreadImplForMessageLoop* impl = | 244 WebThreadImplForMessageLoop* impl = |
240 static_cast<WebThreadImplForMessageLoop*>(thread); | 245 static_cast<WebThreadImplForMessageLoop*>(thread); |
241 delete impl; | 246 delete impl; |
242 } | 247 } |
243 | 248 |
244 } // namespace html_viewer | 249 } // namespace html_viewer |
OLD | NEW |