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

Side by Side Diff: Source/core/dom/DOMArrayBufferDeallocationObserver.cpp

Issue 606653006: bindings: Adds DOMArrayBuffer, etc. as thin wrappers for ArrayBuffer, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed Win GPU tests (DOMDataView). Created 6 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "core/dom/DOMArrayBufferDeallocationObserver.h"
7
8 #include "wtf/StdLibExtras.h"
9 #include <v8.h>
10
11 namespace blink {
12
13 DOMArrayBufferDeallocationObserver* DOMArrayBufferDeallocationObserver::instance ()
14 {
15 DEFINE_STATIC_LOCAL(DOMArrayBufferDeallocationObserver, deallocationObserver , ());
16 return &deallocationObserver;
17 }
18
19 void DOMArrayBufferDeallocationObserver::arrayBufferDeallocated(unsigned sizeInB ytes)
20 {
21 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-static_cas t<int>(sizeInBytes));
haraken 2014/10/14 15:11:19 If possible, we want to pass |isolate| to this met
Yuki 2014/10/15 09:35:23 It seems very hard. These are callback functions
22 }
23
24 void DOMArrayBufferDeallocationObserver::blinkAllocatedMemory(unsigned sizeInByt es)
25 {
26 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(static_cast <int>(sizeInBytes));
haraken 2014/10/14 15:11:19 Ditto.
27 }
28
29 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698