Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Side by Side Diff: webkit/child/webkitplatformsupport_child_impl.cc

Issue 24988003: Refactor DiscardableMemory for the upcoming DiscardableMemoryAllocator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix linux clang build Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/child/web_discardable_memory_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 void WebKitPlatformSupportChildImpl::didStopWorkerRunLoop( 88 void WebKitPlatformSupportChildImpl::didStopWorkerRunLoop(
89 const WebKit::WebWorkerRunLoop& runLoop) { 89 const WebKit::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 WebKit::WebDiscardableMemory* 94 WebKit::WebDiscardableMemory*
95 WebKitPlatformSupportChildImpl::allocateAndLockDiscardableMemory(size_t bytes) { 95 WebKitPlatformSupportChildImpl::allocateAndLockDiscardableMemory(size_t bytes) {
96 if (!base::DiscardableMemory::Supported()) 96 if (!base::DiscardableMemory::Supported())
97 return NULL; 97 return NULL;
98 scoped_ptr<WebDiscardableMemoryImpl> discardable( 98 return WebDiscardableMemoryImpl::CreateLockedMemory(bytes).release();
99 new WebDiscardableMemoryImpl());
100 if (discardable->InitializeAndLock(bytes))
101 return discardable.release();
102 return NULL;
103 } 99 }
104 100
105 // static 101 // static
106 void WebKitPlatformSupportChildImpl::DestroyCurrentThread(void* thread) { 102 void WebKitPlatformSupportChildImpl::DestroyCurrentThread(void* thread) {
107 WebThreadImplForMessageLoop* impl = 103 WebThreadImplForMessageLoop* impl =
108 static_cast<WebThreadImplForMessageLoop*>(thread); 104 static_cast<WebThreadImplForMessageLoop*>(thread);
109 delete impl; 105 delete impl;
110 } 106 }
111 107
112 } // namespace webkit_glue 108 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/child/web_discardable_memory_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698