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

Side by Side Diff: third_party/WebKit/Source/wtf/WTF.cpp

Issue 1776943002: Register ArrayBufferContents' adjustAmountOfMemory in V8Initializer::initialize (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 23 matching lines...) Expand all
34 #include "wtf/Assertions.h" 34 #include "wtf/Assertions.h"
35 #include "wtf/Partitions.h" 35 #include "wtf/Partitions.h"
36 36
37 namespace WTF { 37 namespace WTF {
38 38
39 extern void initializeThreading(); 39 extern void initializeThreading();
40 40
41 bool s_initialized; 41 bool s_initialized;
42 bool s_shutdown; 42 bool s_shutdown;
43 43
44 void initialize(AdjustAmountOfExternalAllocatedMemoryFunction adjustAmountOfExte rnalAllocatedMemoryFunction) 44 void initialize()
45 { 45 {
46 // WTF, and Blink in general, cannot handle being re-initialized, even if sh utdown first. 46 // WTF, and Blink in general, cannot handle being re-initialized, even if sh utdown first.
47 // Make that explicit here. 47 // Make that explicit here.
48 RELEASE_ASSERT(!s_initialized); 48 RELEASE_ASSERT(!s_initialized);
49 RELEASE_ASSERT(!s_shutdown); 49 RELEASE_ASSERT(!s_shutdown);
50 s_initialized = true; 50 s_initialized = true;
51 ArrayBufferContents::setAdjustAmoutOfExternalAllocatedMemoryFunction(adjustA mountOfExternalAllocatedMemoryFunction);
52 initializeThreading(); 51 initializeThreading();
53 } 52 }
54 53
55 void shutdown() 54 void shutdown()
56 { 55 {
57 RELEASE_ASSERT(s_initialized); 56 RELEASE_ASSERT(s_initialized);
58 RELEASE_ASSERT(!s_shutdown); 57 RELEASE_ASSERT(!s_shutdown);
59 s_shutdown = true; 58 s_shutdown = true;
60 } 59 }
61 60
62 bool isShutdown() 61 bool isShutdown()
63 { 62 {
64 return s_shutdown; 63 return s_shutdown;
65 } 64 }
66 65
67 } // namespace WTF 66 } // namespace WTF
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/WTF.h ('k') | third_party/WebKit/Source/wtf/testing/RunAllTests.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698