| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 V8DebuggerImpl* debugger() { return m_debugger; } | 55 V8DebuggerImpl* debugger() { return m_debugger; } |
| 56 | 56 |
| 57 InjectedScript* injectedScriptFor(v8::Local<v8::Context>); | 57 InjectedScript* injectedScriptFor(v8::Local<v8::Context>); |
| 58 InjectedScript* findInjectedScript(ErrorString*, int) const; | 58 InjectedScript* findInjectedScript(ErrorString*, int) const; |
| 59 InjectedScript* findInjectedScript(ErrorString*, RemoteObjectIdBase*) const; | 59 InjectedScript* findInjectedScript(ErrorString*, RemoteObjectIdBase*) const; |
| 60 void discardInjectedScripts(); | 60 void discardInjectedScripts(); |
| 61 int discardInjectedScriptFor(v8::Local<v8::Context>); | 61 int discardInjectedScriptFor(v8::Local<v8::Context>); |
| 62 int discardInjectedScript(int); | 62 int discardInjectedScript(int); |
| 63 void releaseObjectGroup(const String16& objectGroup); | 63 void releaseObjectGroup(const String16& objectGroup); |
| 64 void setCustomObjectFormatterEnabled(bool); | 64 void setCustomObjectFormatterEnabled(bool); |
| 65 | |
| 66 class ScopedGlobalObjectExtension { | |
| 67 PROTOCOL_DISALLOW_COPY(ScopedGlobalObjectExtension); | |
| 68 public: | |
| 69 // Pass InjectedScriptManager to affect all contexts which have access. | |
| 70 ScopedGlobalObjectExtension(InjectedScript* current, InjectedScriptManag
er*, v8::MaybeLocal<v8::Object> extension); | |
| 71 ~ScopedGlobalObjectExtension(); | |
| 72 | |
| 73 private: | |
| 74 void setOnGlobal(v8::Local<v8::Object> global, v8::Local<v8::Object> ext
ension); | |
| 75 | |
| 76 v8::Local<v8::Symbol> m_symbol; | |
| 77 v8::Local<v8::Context> m_context; | |
| 78 Vector<v8::Local<v8::Value>> m_globals; | |
| 79 }; | |
| 80 private: | 65 private: |
| 81 explicit InjectedScriptManager(V8DebuggerImpl*); | 66 explicit InjectedScriptManager(V8DebuggerImpl*); |
| 82 | 67 |
| 83 v8::Local<v8::Object> createInjectedScript(const String16& source, v8::Local
<v8::Context>, int id, InjectedScriptNative*); | 68 v8::Local<v8::Object> createInjectedScript(const String16& source, v8::Local
<v8::Context>, int id, InjectedScriptNative*); |
| 84 | 69 |
| 85 typedef protocol::HashMap<int, OwnPtr<InjectedScript>> IdToInjectedScriptMap
; | 70 typedef protocol::HashMap<int, OwnPtr<InjectedScript>> IdToInjectedScriptMap
; |
| 86 IdToInjectedScriptMap m_idToInjectedScript; | 71 IdToInjectedScriptMap m_idToInjectedScript; |
| 87 OwnPtr<InjectedScriptHost> m_injectedScriptHost; | 72 OwnPtr<InjectedScriptHost> m_injectedScriptHost; |
| 88 bool m_customObjectFormatterEnabled; | 73 bool m_customObjectFormatterEnabled; |
| 89 V8DebuggerImpl* m_debugger; | 74 V8DebuggerImpl* m_debugger; |
| 90 }; | 75 }; |
| 91 | 76 |
| 92 } // namespace blink | 77 } // namespace blink |
| 93 | 78 |
| 94 #endif // !defined(InjectedScriptManager_h) | 79 #endif // !defined(InjectedScriptManager_h) |
| OLD | NEW |