OLD | NEW |
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 class V8DOMActivityLogger; | 52 class V8DOMActivityLogger; |
53 class V8PerContextData; | 53 class V8PerContextData; |
54 | 54 |
55 enum V8ContextEmbedderDataField { | 55 enum V8ContextEmbedderDataField { |
56 kV8ContextPerContextDataIndex = static_cast<int>( | 56 kV8ContextPerContextDataIndex = static_cast<int>( |
57 gin::kPerContextDataStartIndex + // NOLINT(readability/enum_casing) | 57 gin::kPerContextDataStartIndex + // NOLINT(readability/enum_casing) |
58 gin::kEmbedderBlink), // NOLINT(readability/enum_casing) | 58 gin::kEmbedderBlink), // NOLINT(readability/enum_casing) |
59 }; | 59 }; |
60 | 60 |
| 61 // Used to hold data that is associated with a single v8::Context object, and |
| 62 // has a 1:1 relationship with v8::Context. |
61 class PLATFORM_EXPORT V8PerContextData final { | 63 class PLATFORM_EXPORT V8PerContextData final { |
62 USING_FAST_MALLOC(V8PerContextData); | 64 USING_FAST_MALLOC(V8PerContextData); |
63 WTF_MAKE_NONCOPYABLE(V8PerContextData); | 65 WTF_MAKE_NONCOPYABLE(V8PerContextData); |
64 | 66 |
65 public: | 67 public: |
66 static std::unique_ptr<V8PerContextData> Create(v8::Local<v8::Context>); | 68 static std::unique_ptr<V8PerContextData> Create(v8::Local<v8::Context>); |
67 | 69 |
68 static V8PerContextData* From(v8::Local<v8::Context>); | 70 static V8PerContextData* From(v8::Local<v8::Context>); |
69 | 71 |
70 ~V8PerContextData(); | 72 ~V8PerContextData(); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // This is owned by a static hash map in V8DOMActivityLogger. | 145 // This is owned by a static hash map in V8DOMActivityLogger. |
144 V8DOMActivityLogger* activity_logger_; | 146 V8DOMActivityLogger* activity_logger_; |
145 | 147 |
146 using DataMap = PersistentHeapHashMap<const char*, Member<Data>>; | 148 using DataMap = PersistentHeapHashMap<const char*, Member<Data>>; |
147 DataMap data_map_; | 149 DataMap data_map_; |
148 }; | 150 }; |
149 | 151 |
150 } // namespace blink | 152 } // namespace blink |
151 | 153 |
152 #endif // V8PerContextData_h | 154 #endif // V8PerContextData_h |
OLD | NEW |