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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8PerContextData.cpp

Issue 2571063002: Remove Blink-in-JS (Closed)
Patch Set: Created 4 years 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 30 matching lines...) Expand all
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(WTF::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) {
53 m_contextHolder->SetContext(context); 52 m_contextHolder->SetContext(context);
54 53
55 v8::Context::Scope contextScope(context); 54 v8::Context::Scope contextScope(context);
56 ASSERT(m_errorPrototype.isEmpty()); 55 ASSERT(m_errorPrototype.isEmpty());
57 v8::Local<v8::Value> objectValue = 56 v8::Local<v8::Value> objectValue =
58 context->Global() 57 context->Global()
59 ->Get(context, v8AtomicString(m_isolate, "Error")) 58 ->Get(context, v8AtomicString(m_isolate, "Error"))
60 .ToLocalChecked(); 59 .ToLocalChecked();
61 v8::Local<v8::Value> prototypeValue = 60 v8::Local<v8::Value> prototypeValue =
62 objectValue.As<v8::Object>() 61 objectValue.As<v8::Object>()
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 !prototypeValue->IsObject()) 167 !prototypeValue->IsObject())
169 return v8::Local<v8::Object>(); 168 return v8::Local<v8::Object>();
170 return prototypeValue.As<v8::Object>(); 169 return prototypeValue.As<v8::Object>();
171 } 170 }
172 171
173 void V8PerContextData::addCustomElementBinding( 172 void V8PerContextData::addCustomElementBinding(
174 std::unique_ptr<V0CustomElementBinding> binding) { 173 std::unique_ptr<V0CustomElementBinding> binding) {
175 m_customElementBindings.push_back(std::move(binding)); 174 m_customElementBindings.push_back(std::move(binding));
176 } 175 }
177 176
178 v8::Local<v8::Value> V8PerContextData::compiledPrivateScript(String className) {
179 return m_compiledPrivateScript.Get(className);
180 }
181
182 void V8PerContextData::setCompiledPrivateScript(
183 String className,
184 v8::Local<v8::Value> compiledObject) {
185 m_compiledPrivateScript.Set(className, compiledObject);
186 }
187
188 } // namespace blink 177 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698