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

Side by Side Diff: Source/bindings/v8/custom/V8InjectedScriptManager.cpp

Issue 176963017: Remove WrapperWorldType from V8 binding (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 namespace WebCore { 47 namespace WebCore {
48 48
49 struct InjectedScriptManager::CallbackData { 49 struct InjectedScriptManager::CallbackData {
50 ScopedPersistent<v8::Object> handle; 50 ScopedPersistent<v8::Object> handle;
51 RefPtr<InjectedScriptHost> host; 51 RefPtr<InjectedScriptHost> host;
52 }; 52 };
53 53
54 static v8::Local<v8::Object> createInjectedScriptHostV8Wrapper(InjectedScriptHos t* host, v8::Isolate* isolate) 54 static v8::Local<v8::Object> createInjectedScriptHostV8Wrapper(InjectedScriptHos t* host, v8::Isolate* isolate)
55 { 55 {
56 v8::Local<v8::Function> function = V8InjectedScriptHost::domTemplate(isolate , MainWorld)->GetFunction(); 56 v8::Local<v8::Function> function = V8InjectedScriptHost::domTemplate(isolate )->GetFunction();
57 if (function.IsEmpty()) { 57 if (function.IsEmpty()) {
58 // Return if allocation failed. 58 // Return if allocation failed.
59 return v8::Local<v8::Object>(); 59 return v8::Local<v8::Object>();
60 } 60 }
61 v8::Local<v8::Object> instanceTemplate = V8ObjectConstructor::newInstance(fu nction); 61 v8::Local<v8::Object> instanceTemplate = V8ObjectConstructor::newInstance(fu nction);
62 if (instanceTemplate.IsEmpty()) { 62 if (instanceTemplate.IsEmpty()) {
63 // Avoid setting the wrapper if allocation failed. 63 // Avoid setting the wrapper if allocation failed.
64 return v8::Local<v8::Object>(); 64 return v8::Local<v8::Object>();
65 } 65 }
66 V8DOMWrapper::setNativeInfo(instanceTemplate, &V8InjectedScriptHost::wrapper TypeInfo, host); 66 V8DOMWrapper::setNativeInfo(instanceTemplate, &V8InjectedScriptHost::wrapper TypeInfo, host);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } 121 }
122 122
123 void InjectedScriptManager::setWeakCallback(const v8::WeakCallbackData<v8::Objec t, InjectedScriptManager::CallbackData>& data) 123 void InjectedScriptManager::setWeakCallback(const v8::WeakCallbackData<v8::Objec t, InjectedScriptManager::CallbackData>& data)
124 { 124 {
125 data.GetParameter()->handle.clear(); 125 data.GetParameter()->handle.clear();
126 data.GetParameter()->host.clear(); 126 data.GetParameter()->host.clear();
127 delete data.GetParameter(); 127 delete data.GetParameter();
128 } 128 }
129 129
130 } // namespace WebCore 130 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/custom/V8ArrayBufferCustom.h ('k') | Source/bindings/v8/custom/V8PromiseCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698