OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "webkit/child/webkitplatformsupport_child_impl.h" | 5 #include "webkit/child/webkitplatformsupport_child_impl.h" |
6 | 6 |
7 #include "base/memory/discardable_memory.h" | 7 #include "base/memory/discardable_memory.h" |
8 #include "third_party/WebKit/public/web/WebInputEvent.h" | 8 #include "third_party/WebKit/public/web/WebInputEvent.h" |
9 #include "webkit/child/fling_curve_configuration.h" | 9 #include "webkit/child/fling_curve_configuration.h" |
10 #include "webkit/child/web_discardable_memory_impl.h" | 10 #include "webkit/child/web_discardable_memory_impl.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 } | 86 } |
87 | 87 |
88 void WebKitPlatformSupportChildImpl::didStopWorkerRunLoop( | 88 void WebKitPlatformSupportChildImpl::didStopWorkerRunLoop( |
89 const blink::WebWorkerRunLoop& runLoop) { | 89 const blink::WebWorkerRunLoop& runLoop) { |
90 WorkerTaskRunner* worker_task_runner = WorkerTaskRunner::Instance(); | 90 WorkerTaskRunner* worker_task_runner = WorkerTaskRunner::Instance(); |
91 worker_task_runner->OnWorkerRunLoopStopped(runLoop); | 91 worker_task_runner->OnWorkerRunLoopStopped(runLoop); |
92 } | 92 } |
93 | 93 |
94 blink::WebDiscardableMemory* | 94 blink::WebDiscardableMemory* |
95 WebKitPlatformSupportChildImpl::allocateAndLockDiscardableMemory(size_t bytes) { | 95 WebKitPlatformSupportChildImpl::allocateAndLockDiscardableMemory(size_t bytes) { |
96 if (!base::DiscardableMemory::SupportedNatively()) | 96 base::DiscardableMemoryType type = |
| 97 base::DiscardableMemory::GetPreferredType(); |
| 98 if (type == base::DISCARDABLE_MEMORY_TYPE_EMULATED) |
97 return NULL; | 99 return NULL; |
98 return WebDiscardableMemoryImpl::CreateLockedMemory(bytes).release(); | 100 return WebDiscardableMemoryImpl::CreateLockedMemory(bytes).release(); |
99 } | 101 } |
100 | 102 |
101 // static | 103 // static |
102 void WebKitPlatformSupportChildImpl::DestroyCurrentThread(void* thread) { | 104 void WebKitPlatformSupportChildImpl::DestroyCurrentThread(void* thread) { |
103 WebThreadImplForMessageLoop* impl = | 105 WebThreadImplForMessageLoop* impl = |
104 static_cast<WebThreadImplForMessageLoop*>(thread); | 106 static_cast<WebThreadImplForMessageLoop*>(thread); |
105 delete impl; | 107 delete impl; |
106 } | 108 } |
107 | 109 |
108 } // namespace webkit_glue | 110 } // namespace webkit_glue |
OLD | NEW |