| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 { | 50 { |
| 51 OwnPtr<InjectedScriptManager::CallbackData> callbackData = adoptPtr(new Inje
ctedScriptManager::CallbackData()); | 51 OwnPtr<InjectedScriptManager::CallbackData> callbackData = adoptPtr(new Inje
ctedScriptManager::CallbackData()); |
| 52 InjectedScriptManager::CallbackData* callbackDataPtr = callbackData.get(); | 52 InjectedScriptManager::CallbackData* callbackDataPtr = callbackData.get(); |
| 53 callbackData->injectedScriptManager = injectedScriptManager; | 53 callbackData->injectedScriptManager = injectedScriptManager; |
| 54 m_callbackDataSet.add(callbackData.release()); | 54 m_callbackDataSet.add(callbackData.release()); |
| 55 return callbackDataPtr; | 55 return callbackDataPtr; |
| 56 } | 56 } |
| 57 | 57 |
| 58 void InjectedScriptManager::removeCallbackData(InjectedScriptManager::CallbackDa
ta* callbackData) | 58 void InjectedScriptManager::removeCallbackData(InjectedScriptManager::CallbackDa
ta* callbackData) |
| 59 { | 59 { |
| 60 fprintf(stderr, "b %p\n", callbackData); | |
| 61 ASSERT(m_callbackDataSet.contains(callbackData)); | 60 ASSERT(m_callbackDataSet.contains(callbackData)); |
| 62 fprintf(stderr, "c %p\n", callbackData); | |
| 63 m_callbackDataSet.remove(callbackData); | 61 m_callbackDataSet.remove(callbackData); |
| 64 fprintf(stderr, "d %p\n", callbackData); | |
| 65 } | 62 } |
| 66 | 63 |
| 67 static v8::Local<v8::Object> createInjectedScriptHostV8Wrapper(PassRefPtrWillBeR
awPtr<InjectedScriptHost> host, InjectedScriptManager* injectedScriptManager, v8
::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 64 static v8::Local<v8::Object> createInjectedScriptHostV8Wrapper(PassRefPtrWillBeR
awPtr<InjectedScriptHost> host, InjectedScriptManager* injectedScriptManager, v8
::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 68 { | 65 { |
| 69 ASSERT(host); | 66 ASSERT(host); |
| 70 | 67 |
| 71 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &V8InjectedScriptHost::wrapperTypeInfo, V8InjectedScriptHost::toInternalPointe
r(host.get()), isolate); | 68 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &V8InjectedScriptHost::wrapperTypeInfo, V8InjectedScriptHost::toInternalPointe
r(host.get()), isolate); |
| 72 if (UNLIKELY(wrapper.IsEmpty())) | 69 if (UNLIKELY(wrapper.IsEmpty())) |
| 73 return wrapper; | 70 return wrapper; |
| 74 | 71 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 if (holder.IsEmpty()) | 123 if (holder.IsEmpty()) |
| 127 return false; | 124 return false; |
| 128 LocalFrame* frame = V8Window::toNative(holder)->frame(); | 125 LocalFrame* frame = V8Window::toNative(holder)->frame(); |
| 129 | 126 |
| 130 return BindingSecurity::shouldAllowAccessToFrame(scriptState->isolate(), fra
me, DoNotReportSecurityError); | 127 return BindingSecurity::shouldAllowAccessToFrame(scriptState->isolate(), fra
me, DoNotReportSecurityError); |
| 131 } | 128 } |
| 132 | 129 |
| 133 void InjectedScriptManager::setWeakCallback(const v8::WeakCallbackData<v8::Objec
t, InjectedScriptManager::CallbackData>& data) | 130 void InjectedScriptManager::setWeakCallback(const v8::WeakCallbackData<v8::Objec
t, InjectedScriptManager::CallbackData>& data) |
| 134 { | 131 { |
| 135 InjectedScriptManager::CallbackData* callbackData = data.GetParameter(); | 132 InjectedScriptManager::CallbackData* callbackData = data.GetParameter(); |
| 136 fprintf(stderr, "a %p\n", callbackData); | |
| 137 callbackData->injectedScriptManager->removeCallbackData(callbackData); | 133 callbackData->injectedScriptManager->removeCallbackData(callbackData); |
| 138 } | 134 } |
| 139 | 135 |
| 140 } // namespace blink | 136 } // namespace blink |
| OLD | NEW |