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

Side by Side Diff: Source/bindings/v8/V8PerIsolateData.cpp

Issue 138223002: WIP: Implement binding layer for Blink-in-JavaScript Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/v8/V8PerIsolateData.h ('k') | Source/build/scripts/make_blink_in_javascript.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 // toString of the DOM constructor itself to change. This is extremely 147 // toString of the DOM constructor itself to change. This is extremely
148 // obscure and unlikely to be a problem. 148 // obscure and unlikely to be a problem.
149 v8::Handle<v8::Value> value = info.Callee()->Get(v8AtomicString(info.GetIsol ate(), "toString")); 149 v8::Handle<v8::Value> value = info.Callee()->Get(v8AtomicString(info.GetIsol ate(), "toString"));
150 if (!value->IsFunction()) { 150 if (!value->IsFunction()) {
151 v8SetReturnValue(info, v8::String::Empty(info.GetIsolate())); 151 v8SetReturnValue(info, v8::String::Empty(info.GetIsolate()));
152 return; 152 return;
153 } 153 }
154 v8SetReturnValue(info, V8ScriptRunner::callInternalFunction(v8::Handle<v8::F unction>::Cast(value), info.This(), 0, 0, v8::Isolate::GetCurrent())); 154 v8SetReturnValue(info, V8ScriptRunner::callInternalFunction(v8::Handle<v8::F unction>::Cast(value), info.This(), 0, 0, v8::Isolate::GetCurrent()));
155 } 155 }
156 156
157 v8::Handle<v8::Value> V8PerIsolateData::compiledBlinkInJavaScript(String classNa me)
158 {
159 HashMap<String, UnsafePersistent<v8::Value> >::iterator it = m_compiledBlink InJavaScript.find(className);
160 if (it != m_compiledBlinkInJavaScript.end())
161 return it->value.newLocal(m_isolate);
162 return v8::Handle<v8::Value>();
163 }
164
165 void V8PerIsolateData::setCompiledBlinkInJavaScript(String className, v8::Handle <v8::Value> compiledObject)
166 {
167 m_compiledBlinkInJavaScript.set(className, UnsafePersistent<v8::Value>(m_iso late, compiledObject));
168 }
169
157 } // namespace WebCore 170 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8PerIsolateData.h ('k') | Source/build/scripts/make_blink_in_javascript.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698