OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2008, 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 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 23 matching lines...) Expand all Loading... |
34 #include "bindings/v8/ScopedPersistent.h" | 34 #include "bindings/v8/ScopedPersistent.h" |
35 #include <v8.h> | 35 #include <v8.h> |
36 #include "wtf/PassRefPtr.h" | 36 #include "wtf/PassRefPtr.h" |
37 #include "wtf/RefCounted.h" | 37 #include "wtf/RefCounted.h" |
38 #include "wtf/RefPtr.h" | 38 #include "wtf/RefPtr.h" |
39 | 39 |
40 namespace WebCore { | 40 namespace WebCore { |
41 | 41 |
42 class V8ScriptInstance : public RefCounted<V8ScriptInstance> { | 42 class V8ScriptInstance : public RefCounted<V8ScriptInstance> { |
43 public: | 43 public: |
44 static PassRefPtr<V8ScriptInstance> create(v8::Handle<v8::Object> instance)
{ return adoptRef(new V8ScriptInstance(instance)); } | 44 static PassRefPtr<V8ScriptInstance> create(v8::Handle<v8::Object> instance,
v8::Isolate* isolate) { return adoptRef(new V8ScriptInstance(instance, isolate))
; } |
45 | 45 |
46 v8::Local<v8::Object> newLocal(v8::Isolate* isolate) { return m_instance.new
Local(isolate); } | 46 v8::Local<v8::Object> newLocal(v8::Isolate* isolate) { return m_instance.new
Local(isolate); } |
47 | 47 |
48 private: | 48 private: |
49 explicit V8ScriptInstance(v8::Handle<v8::Object>); | 49 V8ScriptInstance(v8::Handle<v8::Object>, v8::Isolate*); |
50 | 50 |
51 ScopedPersistent<v8::Object> m_instance; | 51 ScopedPersistent<v8::Object> m_instance; |
52 }; | 52 }; |
53 | 53 |
54 typedef RefPtr<V8ScriptInstance> ScriptInstance; | 54 typedef RefPtr<V8ScriptInstance> ScriptInstance; |
55 typedef PassRefPtr<V8ScriptInstance> PassScriptInstance; | 55 typedef PassRefPtr<V8ScriptInstance> PassScriptInstance; |
56 | 56 |
57 } // namespace WebCore | 57 } // namespace WebCore |
58 | 58 |
59 #endif // ScriptInstance_h | 59 #endif // ScriptInstance_h |
OLD | NEW |