| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> | 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> |
| 4 * Copyright (C) 2012 Google Inc. All rights reserved. | 4 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "core/inspector/InjectedScriptHost.h" | 35 #include "core/inspector/InjectedScriptHost.h" |
| 36 #include "core/inspector/InjectedScriptNative.h" | 36 #include "core/inspector/InjectedScriptNative.h" |
| 37 #include "core/inspector/RemoteObjectId.h" | 37 #include "core/inspector/RemoteObjectId.h" |
| 38 #include "core/inspector/v8/V8Debugger.h" | 38 #include "core/inspector/v8/V8Debugger.h" |
| 39 #include "public/platform/Platform.h" | 39 #include "public/platform/Platform.h" |
| 40 #include "public/platform/WebData.h" | 40 #include "public/platform/WebData.h" |
| 41 #include "wtf/PassOwnPtr.h" | 41 #include "wtf/PassOwnPtr.h" |
| 42 | 42 |
| 43 namespace blink { | 43 namespace blink { |
| 44 | 44 |
| 45 PassOwnPtrWillBeRawPtr<InjectedScriptManager> InjectedScriptManager::createForPa
ge() | 45 PassOwnPtr<InjectedScriptManager> InjectedScriptManager::createForPage() |
| 46 { | 46 { |
| 47 return adoptPtrWillBeNoop(new InjectedScriptManager(&InjectedScriptManager::
canAccessInspectedWindow)); | 47 return adoptPtr(new InjectedScriptManager(&InjectedScriptManager::canAccessI
nspectedWindow)); |
| 48 } | 48 } |
| 49 | 49 |
| 50 PassOwnPtrWillBeRawPtr<InjectedScriptManager> InjectedScriptManager::createForWo
rker() | 50 PassOwnPtr<InjectedScriptManager> InjectedScriptManager::createForWorker() |
| 51 { | 51 { |
| 52 return adoptPtrWillBeNoop(new InjectedScriptManager(&InjectedScriptManager::
canAccessInspectedWorkerGlobalScope)); | 52 return adoptPtr(new InjectedScriptManager(&InjectedScriptManager::canAccessI
nspectedWorkerGlobalScope)); |
| 53 } | 53 } |
| 54 | 54 |
| 55 InjectedScriptManager::InjectedScriptManager(InspectedStateAccessCheck accessChe
ck) | 55 InjectedScriptManager::InjectedScriptManager(InspectedStateAccessCheck accessChe
ck) |
| 56 : m_injectedScriptHost(InjectedScriptHost::create()) | 56 : m_injectedScriptHost(InjectedScriptHost::create()) |
| 57 , m_inspectedStateAccessCheck(accessCheck) | 57 , m_inspectedStateAccessCheck(accessCheck) |
| 58 , m_customObjectFormatterEnabled(false) | 58 , m_customObjectFormatterEnabled(false) |
| 59 { | 59 { |
| 60 } | 60 } |
| 61 | 61 |
| 62 InjectedScriptManager::~InjectedScriptManager() | 62 InjectedScriptManager::~InjectedScriptManager() |
| 63 { | 63 { |
| 64 } | 64 } |
| 65 | 65 |
| 66 DEFINE_TRACE(InjectedScriptManager) | |
| 67 { | |
| 68 visitor->trace(m_injectedScriptHost); | |
| 69 } | |
| 70 | |
| 71 void InjectedScriptManager::disconnect() | 66 void InjectedScriptManager::disconnect() |
| 72 { | 67 { |
| 73 m_injectedScriptHost->disconnect(); | 68 m_injectedScriptHost->disconnect(); |
| 74 m_injectedScriptHost.clear(); | 69 m_injectedScriptHost.clear(); |
| 75 } | 70 } |
| 76 | 71 |
| 77 InjectedScriptHost* InjectedScriptManager::injectedScriptHost() | 72 InjectedScriptHost* InjectedScriptManager::injectedScriptHost() |
| 78 { | 73 { |
| 79 return m_injectedScriptHost.get(); | 74 return m_injectedScriptHost.get(); |
| 80 } | 75 } |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 RefPtr<InjectedScriptNative> injectedScriptNative = adoptRef(new InjectedScr
iptNative(scriptState->isolate())); | 149 RefPtr<InjectedScriptNative> injectedScriptNative = adoptRef(new InjectedScr
iptNative(scriptState->isolate())); |
| 155 ScriptValue injectedScriptValue = createInjectedScript(injectedScriptSource(
), scriptState, contextId, injectedScriptNative.get()); | 150 ScriptValue injectedScriptValue = createInjectedScript(injectedScriptSource(
), scriptState, contextId, injectedScriptNative.get()); |
| 156 InjectedScript result(injectedScriptValue, m_inspectedStateAccessCheck, inje
ctedScriptNative.release(), contextId); | 151 InjectedScript result(injectedScriptValue, m_inspectedStateAccessCheck, inje
ctedScriptNative.release(), contextId); |
| 157 if (m_customObjectFormatterEnabled) | 152 if (m_customObjectFormatterEnabled) |
| 158 result.setCustomObjectFormatterEnabled(m_customObjectFormatterEnabled); | 153 result.setCustomObjectFormatterEnabled(m_customObjectFormatterEnabled); |
| 159 m_idToInjectedScript.set(contextId, result); | 154 m_idToInjectedScript.set(contextId, result); |
| 160 return result; | 155 return result; |
| 161 } | 156 } |
| 162 | 157 |
| 163 } // namespace blink | 158 } // namespace blink |
| OLD | NEW |