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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 USING_FAST_MALLOC(InjectedScriptManager); | 50 USING_FAST_MALLOC(InjectedScriptManager); |
51 public: | 51 public: |
52 static PassOwnPtr<InjectedScriptManager> createForPage(); | 52 static PassOwnPtr<InjectedScriptManager> createForPage(); |
53 static PassOwnPtr<InjectedScriptManager> createForWorker(); | 53 static PassOwnPtr<InjectedScriptManager> createForWorker(); |
54 ~InjectedScriptManager(); | 54 ~InjectedScriptManager(); |
55 | 55 |
56 void disconnect(); | 56 void disconnect(); |
57 | 57 |
58 InjectedScriptHost* injectedScriptHost(); | 58 InjectedScriptHost* injectedScriptHost(); |
59 | 59 |
60 InjectedScript injectedScriptFor(ScriptState*); | 60 InjectedScript* injectedScriptFor(ScriptState*); |
61 InjectedScript findInjectedScript(int) const; | 61 InjectedScript* findInjectedScript(int) const; |
62 InjectedScript findInjectedScript(RemoteObjectIdBase*) const; | 62 InjectedScript* findInjectedScript(RemoteObjectIdBase*) const; |
63 void discardInjectedScripts(); | 63 void discardInjectedScripts(); |
64 int discardInjectedScriptFor(ScriptState*); | 64 int discardInjectedScriptFor(ScriptState*); |
65 void releaseObjectGroup(const String& objectGroup); | 65 void releaseObjectGroup(const String& objectGroup); |
66 | 66 |
67 typedef bool (*InspectedStateAccessCheck)(ScriptState*); | 67 typedef bool (*InspectedStateAccessCheck)(ScriptState*); |
68 InspectedStateAccessCheck inspectedStateAccessCheck() const { return m_inspe
ctedStateAccessCheck; } | 68 InspectedStateAccessCheck inspectedStateAccessCheck() const { return m_inspe
ctedStateAccessCheck; } |
69 | 69 |
70 void setCustomObjectFormatterEnabled(bool); | 70 void setCustomObjectFormatterEnabled(bool); |
71 | 71 |
72 private: | 72 private: |
73 explicit InjectedScriptManager(InspectedStateAccessCheck); | 73 explicit InjectedScriptManager(InspectedStateAccessCheck); |
74 | 74 |
75 String injectedScriptSource(); | 75 String injectedScriptSource(); |
76 ScriptValue createInjectedScript(const String& source, ScriptState*, int id,
InjectedScriptNative*); | 76 ScriptValue createInjectedScript(const String& source, ScriptState*, int id,
InjectedScriptNative*); |
77 | 77 |
78 static bool canAccessInspectedWindow(ScriptState*); | 78 static bool canAccessInspectedWindow(ScriptState*); |
79 static bool canAccessInspectedWorkerGlobalScope(ScriptState*); | 79 static bool canAccessInspectedWorkerGlobalScope(ScriptState*); |
80 | 80 |
81 typedef HashMap<int, InjectedScript> IdToInjectedScriptMap; | 81 typedef HashMap<int, OwnPtr<InjectedScript>> IdToInjectedScriptMap; |
82 IdToInjectedScriptMap m_idToInjectedScript; | 82 IdToInjectedScriptMap m_idToInjectedScript; |
83 RefPtr<InjectedScriptHost> m_injectedScriptHost; | 83 RefPtr<InjectedScriptHost> m_injectedScriptHost; |
84 InspectedStateAccessCheck m_inspectedStateAccessCheck; | 84 InspectedStateAccessCheck m_inspectedStateAccessCheck; |
85 bool m_customObjectFormatterEnabled; | 85 bool m_customObjectFormatterEnabled; |
86 }; | 86 }; |
87 | 87 |
88 } // namespace blink | 88 } // namespace blink |
89 | 89 |
90 #endif // !defined(InjectedScriptManager_h) | 90 #endif // !defined(InjectedScriptManager_h) |
OLD | NEW |