| 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 23 matching lines...) Expand all Loading... |
| 34 #include "bindings/v8/ScriptValue.h" | 34 #include "bindings/v8/ScriptValue.h" |
| 35 #include "core/InjectedScriptSource.h" | 35 #include "core/InjectedScriptSource.h" |
| 36 #include "core/inspector/InjectedScript.h" | 36 #include "core/inspector/InjectedScript.h" |
| 37 #include "core/inspector/InjectedScriptHost.h" | 37 #include "core/inspector/InjectedScriptHost.h" |
| 38 #include "core/inspector/JSONParser.h" | 38 #include "core/inspector/JSONParser.h" |
| 39 #include "platform/JSONValues.h" | 39 #include "platform/JSONValues.h" |
| 40 #include "wtf/PassOwnPtr.h" | 40 #include "wtf/PassOwnPtr.h" |
| 41 | 41 |
| 42 namespace WebCore { | 42 namespace WebCore { |
| 43 | 43 |
| 44 PassOwnPtr<InjectedScriptManager> InjectedScriptManager::createForPage() | 44 PassOwnPtrWillBeRawPtr<InjectedScriptManager> InjectedScriptManager::createForPa
ge() |
| 45 { | 45 { |
| 46 return adoptPtr(new InjectedScriptManager(&InjectedScriptManager::canAccessI
nspectedWindow)); | 46 return adoptPtrWillBeNoop(new InjectedScriptManager(&InjectedScriptManager::
canAccessInspectedWindow)); |
| 47 } | 47 } |
| 48 | 48 |
| 49 PassOwnPtr<InjectedScriptManager> InjectedScriptManager::createForWorker() | 49 PassOwnPtrWillBeRawPtr<InjectedScriptManager> InjectedScriptManager::createForWo
rker() |
| 50 { | 50 { |
| 51 return adoptPtr(new InjectedScriptManager(&InjectedScriptManager::canAccessI
nspectedWorkerGlobalScope)); | 51 return adoptPtrWillBeNoop(new InjectedScriptManager(&InjectedScriptManager::
canAccessInspectedWorkerGlobalScope)); |
| 52 } | 52 } |
| 53 | 53 |
| 54 InjectedScriptManager::InjectedScriptManager(InspectedStateAccessCheck accessChe
ck) | 54 InjectedScriptManager::InjectedScriptManager(InspectedStateAccessCheck accessChe
ck) |
| 55 : m_nextInjectedScriptId(1) | 55 : m_nextInjectedScriptId(1) |
| 56 , m_injectedScriptHost(InjectedScriptHost::create()) | 56 , m_injectedScriptHost(InjectedScriptHost::create()) |
| 57 , m_inspectedStateAccessCheck(accessCheck) | 57 , m_inspectedStateAccessCheck(accessCheck) |
| 58 { | 58 { |
| 59 } | 59 } |
| 60 | 60 |
| 61 InjectedScriptManager::~InjectedScriptManager() | 61 InjectedScriptManager::~InjectedScriptManager() |
| 62 { | 62 { |
| 63 } | 63 } |
| 64 | 64 |
| 65 void InjectedScriptManager::trace(Visitor* visitor) |
| 66 { |
| 67 visitor->trace(m_injectedScriptHost); |
| 68 } |
| 69 |
| 65 void InjectedScriptManager::disconnect() | 70 void InjectedScriptManager::disconnect() |
| 66 { | 71 { |
| 67 m_injectedScriptHost->disconnect(); | 72 m_injectedScriptHost->disconnect(); |
| 68 m_injectedScriptHost.clear(); | 73 m_injectedScriptHost.clear(); |
| 69 } | 74 } |
| 70 | 75 |
| 71 InjectedScriptHost* InjectedScriptManager::injectedScriptHost() | 76 InjectedScriptHost* InjectedScriptManager::injectedScriptHost() |
| 72 { | 77 { |
| 73 return m_injectedScriptHost.get(); | 78 return m_injectedScriptHost.get(); |
| 74 } | 79 } |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 179 |
| 175 int id = injectedScriptIdFor(inspectedScriptState); | 180 int id = injectedScriptIdFor(inspectedScriptState); |
| 176 ScriptValue injectedScriptValue = createInjectedScript(injectedScriptSource(
), inspectedScriptState, id); | 181 ScriptValue injectedScriptValue = createInjectedScript(injectedScriptSource(
), inspectedScriptState, id); |
| 177 InjectedScript result(injectedScriptValue, m_inspectedStateAccessCheck); | 182 InjectedScript result(injectedScriptValue, m_inspectedStateAccessCheck); |
| 178 m_idToInjectedScript.set(id, result); | 183 m_idToInjectedScript.set(id, result); |
| 179 return result; | 184 return result; |
| 180 } | 185 } |
| 181 | 186 |
| 182 } // namespace WebCore | 187 } // namespace WebCore |
| 183 | 188 |
| OLD | NEW |