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

Side by Side Diff: Source/bindings/core/v8/V8PerContextData.h

Issue 1278983003: Adding allocator annotations to blink classes and structs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed patch conflict Created 5 years, 4 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 20 matching lines...) Expand all
31 #ifndef V8PerContextData_h 31 #ifndef V8PerContextData_h
32 #define V8PerContextData_h 32 #define V8PerContextData_h
33 33
34 #include "bindings/core/v8/CustomElementBinding.h" 34 #include "bindings/core/v8/CustomElementBinding.h"
35 #include "bindings/core/v8/ScopedPersistent.h" 35 #include "bindings/core/v8/ScopedPersistent.h"
36 #include "bindings/core/v8/V8GlobalValueMap.h" 36 #include "bindings/core/v8/V8GlobalValueMap.h"
37 #include "bindings/core/v8/WrapperTypeInfo.h" 37 #include "bindings/core/v8/WrapperTypeInfo.h"
38 #include "core/CoreExport.h" 38 #include "core/CoreExport.h"
39 #include "gin/public/context_holder.h" 39 #include "gin/public/context_holder.h"
40 #include "gin/public/gin_embedders.h" 40 #include "gin/public/gin_embedders.h"
41 #include "wtf/Allocator.h"
41 #include "wtf/HashMap.h" 42 #include "wtf/HashMap.h"
42 #include "wtf/PassOwnPtr.h" 43 #include "wtf/PassOwnPtr.h"
43 #include "wtf/Vector.h" 44 #include "wtf/Vector.h"
44 #include "wtf/text/AtomicString.h" 45 #include "wtf/text/AtomicString.h"
45 #include "wtf/text/AtomicStringHash.h" 46 #include "wtf/text/AtomicStringHash.h"
46 #include <v8.h> 47 #include <v8.h>
47 48
48 namespace blink { 49 namespace blink {
49 50
50 class CustomElementDefinition; 51 class CustomElementDefinition;
51 class V8DOMActivityLogger; 52 class V8DOMActivityLogger;
52 class V8PerContextData; 53 class V8PerContextData;
53 struct V8NPObject; 54 struct V8NPObject;
54 typedef WTF::Vector<V8NPObject*> V8NPObjectVector; 55 typedef WTF::Vector<V8NPObject*> V8NPObjectVector;
55 typedef WTF::HashMap<int, V8NPObjectVector> V8NPObjectMap; 56 typedef WTF::HashMap<int, V8NPObjectVector> V8NPObjectMap;
56 57
57 enum V8ContextEmbedderDataField { 58 enum V8ContextEmbedderDataField {
58 v8ContextPerContextDataIndex = static_cast<int>(gin::kPerContextDataStartInd ex + gin::kEmbedderBlink), 59 v8ContextPerContextDataIndex = static_cast<int>(gin::kPerContextDataStartInd ex + gin::kEmbedderBlink),
59 }; 60 };
60 61
61 class CORE_EXPORT V8PerContextData final { 62 class CORE_EXPORT V8PerContextData final {
63 WTF_MAKE_FAST_ALLOCATED(V8PerContextData);
64 WTF_MAKE_NONCOPYABLE(V8PerContextData);
62 public: 65 public:
63 static PassOwnPtr<V8PerContextData> create(v8::Local<v8::Context>); 66 static PassOwnPtr<V8PerContextData> create(v8::Local<v8::Context>);
64 67
65 static V8PerContextData* from(v8::Local<v8::Context>); 68 static V8PerContextData* from(v8::Local<v8::Context>);
66 69
67 ~V8PerContextData(); 70 ~V8PerContextData();
68 71
69 v8::Local<v8::Context> context() { return m_context.newLocal(m_isolate); } 72 v8::Local<v8::Context> context() { return m_context.newLocal(m_isolate); }
70 73
71 // To create JS Wrapper objects, we create a cache of a 'boiler plate' 74 // To create JS Wrapper objects, we create a cache of a 'boiler plate'
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 126
124 // This is owned by a static hash map in V8DOMActivityLogger. 127 // This is owned by a static hash map in V8DOMActivityLogger.
125 V8DOMActivityLogger* m_activityLogger; 128 V8DOMActivityLogger* m_activityLogger;
126 129
127 V8GlobalValueMap<String, v8::Value, v8::kNotWeak> m_compiledPrivateScript; 130 V8GlobalValueMap<String, v8::Value, v8::kNotWeak> m_compiledPrivateScript;
128 }; 131 };
129 132
130 } // namespace blink 133 } // namespace blink
131 134
132 #endif // V8PerContextData_h 135 #endif // V8PerContextData_h
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8PagePopupControllerBinding.h ('k') | Source/bindings/core/v8/V8PerIsolateData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698