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