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 28 matching lines...) Expand all Loading... |
39 #include "wtf/StringExtras.h" | 39 #include "wtf/StringExtras.h" |
40 #include <memory> | 40 #include <memory> |
41 #include <stdlib.h> | 41 #include <stdlib.h> |
42 | 42 |
43 namespace blink { | 43 namespace blink { |
44 | 44 |
45 V8PerContextData::V8PerContextData(v8::Local<v8::Context> context) | 45 V8PerContextData::V8PerContextData(v8::Local<v8::Context> context) |
46 : m_isolate(context->GetIsolate()), | 46 : m_isolate(context->GetIsolate()), |
47 m_wrapperBoilerplates(m_isolate), | 47 m_wrapperBoilerplates(m_isolate), |
48 m_constructorMap(m_isolate), | 48 m_constructorMap(m_isolate), |
49 m_contextHolder(makeUnique<gin::ContextHolder>(m_isolate)), | 49 m_contextHolder(WTF::makeUnique<gin::ContextHolder>(m_isolate)), |
50 m_context(m_isolate, context), | 50 m_context(m_isolate, context), |
51 m_activityLogger(0), | 51 m_activityLogger(0), |
52 m_compiledPrivateScript(m_isolate) { | 52 m_compiledPrivateScript(m_isolate) { |
53 m_contextHolder->SetContext(context); | 53 m_contextHolder->SetContext(context); |
54 | 54 |
55 v8::Context::Scope contextScope(context); | 55 v8::Context::Scope contextScope(context); |
56 ASSERT(m_errorPrototype.isEmpty()); | 56 ASSERT(m_errorPrototype.isEmpty()); |
57 v8::Local<v8::Value> objectValue = | 57 v8::Local<v8::Value> objectValue = |
58 context->Global() | 58 context->Global() |
59 ->Get(context, v8AtomicString(m_isolate, "Error")) | 59 ->Get(context, v8AtomicString(m_isolate, "Error")) |
(...skipping 10 matching lines...) Expand all Loading... |
70 } | 70 } |
71 | 71 |
72 V8PerContextData::~V8PerContextData() { | 72 V8PerContextData::~V8PerContextData() { |
73 if (isMainThread()) | 73 if (isMainThread()) |
74 InstanceCounters::decrementCounter( | 74 InstanceCounters::decrementCounter( |
75 InstanceCounters::V8PerContextDataCounter); | 75 InstanceCounters::V8PerContextDataCounter); |
76 } | 76 } |
77 | 77 |
78 std::unique_ptr<V8PerContextData> V8PerContextData::create( | 78 std::unique_ptr<V8PerContextData> V8PerContextData::create( |
79 v8::Local<v8::Context> context) { | 79 v8::Local<v8::Context> context) { |
80 return wrapUnique(new V8PerContextData(context)); | 80 return WTF::wrapUnique(new V8PerContextData(context)); |
81 } | 81 } |
82 | 82 |
83 V8PerContextData* V8PerContextData::from(v8::Local<v8::Context> context) { | 83 V8PerContextData* V8PerContextData::from(v8::Local<v8::Context> context) { |
84 return ScriptState::from(context)->perContextData(); | 84 return ScriptState::from(context)->perContextData(); |
85 } | 85 } |
86 | 86 |
87 v8::Local<v8::Object> V8PerContextData::createWrapperFromCacheSlowCase( | 87 v8::Local<v8::Object> V8PerContextData::createWrapperFromCacheSlowCase( |
88 const WrapperTypeInfo* type) { | 88 const WrapperTypeInfo* type) { |
89 ASSERT(!m_errorPrototype.isEmpty()); | 89 ASSERT(!m_errorPrototype.isEmpty()); |
90 | 90 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 return m_compiledPrivateScript.Get(className); | 179 return m_compiledPrivateScript.Get(className); |
180 } | 180 } |
181 | 181 |
182 void V8PerContextData::setCompiledPrivateScript( | 182 void V8PerContextData::setCompiledPrivateScript( |
183 String className, | 183 String className, |
184 v8::Local<v8::Value> compiledObject) { | 184 v8::Local<v8::Value> compiledObject) { |
185 m_compiledPrivateScript.Set(className, compiledObject); | 185 m_compiledPrivateScript.Set(className, compiledObject); |
186 } | 186 } |
187 | 187 |
188 } // namespace blink | 188 } // namespace blink |
OLD | NEW |