| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include <v8.h> | 38 #include <v8.h> |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 class InjectedScript; | 42 class InjectedScript; |
| 43 class InjectedScriptHost; | 43 class InjectedScriptHost; |
| 44 class InjectedScriptNative; | 44 class InjectedScriptNative; |
| 45 class RemoteObjectIdBase; | 45 class RemoteObjectIdBase; |
| 46 class ScriptValue; | 46 class ScriptValue; |
| 47 | 47 |
| 48 class CORE_EXPORT InjectedScriptManager : public NoBaseWillBeGarbageCollectedFin
alized<InjectedScriptManager> { | 48 class CORE_EXPORT InjectedScriptManager { |
| 49 WTF_MAKE_NONCOPYABLE(InjectedScriptManager); | 49 WTF_MAKE_NONCOPYABLE(InjectedScriptManager); |
| 50 USING_FAST_MALLOC_WILL_BE_REMOVED(InjectedScriptManager); | 50 USING_FAST_MALLOC(InjectedScriptManager); |
| 51 public: | 51 public: |
| 52 static PassOwnPtrWillBeRawPtr<InjectedScriptManager> createForPage(); | 52 static PassOwnPtr<InjectedScriptManager> createForPage(); |
| 53 static PassOwnPtrWillBeRawPtr<InjectedScriptManager> createForWorker(); | 53 static PassOwnPtr<InjectedScriptManager> createForWorker(); |
| 54 ~InjectedScriptManager(); | 54 ~InjectedScriptManager(); |
| 55 DECLARE_TRACE(); | |
| 56 | 55 |
| 57 void disconnect(); | 56 void disconnect(); |
| 58 | 57 |
| 59 InjectedScriptHost* injectedScriptHost(); | 58 InjectedScriptHost* injectedScriptHost(); |
| 60 | 59 |
| 61 InjectedScript injectedScriptFor(ScriptState*); | 60 InjectedScript injectedScriptFor(ScriptState*); |
| 62 InjectedScript findInjectedScript(int) const; | 61 InjectedScript findInjectedScript(int) const; |
| 63 InjectedScript findInjectedScript(RemoteObjectIdBase*) const; | 62 InjectedScript findInjectedScript(RemoteObjectIdBase*) const; |
| 64 void discardInjectedScripts(); | 63 void discardInjectedScripts(); |
| 65 int discardInjectedScriptFor(ScriptState*); | 64 int discardInjectedScriptFor(ScriptState*); |
| 66 void releaseObjectGroup(const String& objectGroup); | 65 void releaseObjectGroup(const String& objectGroup); |
| 67 | 66 |
| 68 typedef bool (*InspectedStateAccessCheck)(ScriptState*); | 67 typedef bool (*InspectedStateAccessCheck)(ScriptState*); |
| 69 InspectedStateAccessCheck inspectedStateAccessCheck() const { return m_inspe
ctedStateAccessCheck; } | 68 InspectedStateAccessCheck inspectedStateAccessCheck() const { return m_inspe
ctedStateAccessCheck; } |
| 70 | 69 |
| 71 void setCustomObjectFormatterEnabled(bool); | 70 void setCustomObjectFormatterEnabled(bool); |
| 72 | 71 |
| 73 private: | 72 private: |
| 74 explicit InjectedScriptManager(InspectedStateAccessCheck); | 73 explicit InjectedScriptManager(InspectedStateAccessCheck); |
| 75 | 74 |
| 76 String injectedScriptSource(); | 75 String injectedScriptSource(); |
| 77 ScriptValue createInjectedScript(const String& source, ScriptState*, int id,
InjectedScriptNative*); | 76 ScriptValue createInjectedScript(const String& source, ScriptState*, int id,
InjectedScriptNative*); |
| 78 | 77 |
| 79 static bool canAccessInspectedWindow(ScriptState*); | 78 static bool canAccessInspectedWindow(ScriptState*); |
| 80 static bool canAccessInspectedWorkerGlobalScope(ScriptState*); | 79 static bool canAccessInspectedWorkerGlobalScope(ScriptState*); |
| 81 | 80 |
| 82 typedef HashMap<int, InjectedScript> IdToInjectedScriptMap; | 81 typedef HashMap<int, InjectedScript> IdToInjectedScriptMap; |
| 83 IdToInjectedScriptMap m_idToInjectedScript; | 82 IdToInjectedScriptMap m_idToInjectedScript; |
| 84 RefPtrWillBeMember<InjectedScriptHost> m_injectedScriptHost; | 83 RefPtr<InjectedScriptHost> m_injectedScriptHost; |
| 85 InspectedStateAccessCheck m_inspectedStateAccessCheck; | 84 InspectedStateAccessCheck m_inspectedStateAccessCheck; |
| 86 bool m_customObjectFormatterEnabled; | 85 bool m_customObjectFormatterEnabled; |
| 87 }; | 86 }; |
| 88 | 87 |
| 89 } // namespace blink | 88 } // namespace blink |
| 90 | 89 |
| 91 #endif // !defined(InjectedScriptManager_h) | 90 #endif // !defined(InjectedScriptManager_h) |
| OLD | NEW |