Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: src/inspector/inspected-context.h

Issue 2916803005: [inspector] Create InjectedScript per session in each context (Closed)
Patch Set: rebased Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/inspector/injected-script.cc ('k') | src/inspector/inspected-context.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_INSPECTOR_INSPECTEDCONTEXT_H_ 5 #ifndef V8_INSPECTOR_INSPECTEDCONTEXT_H_
6 #define V8_INSPECTOR_INSPECTEDCONTEXT_H_ 6 #define V8_INSPECTOR_INSPECTEDCONTEXT_H_
7 7
8 #include <map> 8 #include <unordered_map>
9 #include <unordered_set> 9 #include <unordered_set>
10 10
11 #include "src/base/macros.h" 11 #include "src/base/macros.h"
12 #include "src/inspector/string-16.h" 12 #include "src/inspector/string-16.h"
13 13
14 #include "include/v8.h" 14 #include "include/v8.h"
15 15
16 namespace v8_inspector { 16 namespace v8_inspector {
17 17
18 class InjectedScript; 18 class InjectedScript;
(...skipping 13 matching lines...) Expand all
32 String16 origin() const { return m_origin; } 32 String16 origin() const { return m_origin; }
33 String16 humanReadableName() const { return m_humanReadableName; } 33 String16 humanReadableName() const { return m_humanReadableName; }
34 String16 auxData() const { return m_auxData; } 34 String16 auxData() const { return m_auxData; }
35 35
36 bool isReported(int sessionId) const; 36 bool isReported(int sessionId) const;
37 void setReported(int sessionId, bool reported); 37 void setReported(int sessionId, bool reported);
38 38
39 v8::Isolate* isolate() const; 39 v8::Isolate* isolate() const;
40 V8InspectorImpl* inspector() const { return m_inspector; } 40 V8InspectorImpl* inspector() const { return m_inspector; }
41 41
42 InjectedScript* getInjectedScript() { return m_injectedScript.get(); } 42 InjectedScript* getInjectedScript(int sessionId);
43 bool createInjectedScript(); 43 bool createInjectedScript(int sessionId);
44 void discardInjectedScript(); 44 void discardInjectedScript(int sessionId);
45 45
46 private: 46 private:
47 friend class V8InspectorImpl; 47 friend class V8InspectorImpl;
48 InspectedContext(V8InspectorImpl*, const V8ContextInfo&, int contextId); 48 InspectedContext(V8InspectorImpl*, const V8ContextInfo&, int contextId);
49 49
50 V8InspectorImpl* m_inspector; 50 V8InspectorImpl* m_inspector;
51 v8::Global<v8::Context> m_context; 51 v8::Global<v8::Context> m_context;
52 int m_contextId; 52 int m_contextId;
53 int m_contextGroupId; 53 int m_contextGroupId;
54 const String16 m_origin; 54 const String16 m_origin;
55 const String16 m_humanReadableName; 55 const String16 m_humanReadableName;
56 const String16 m_auxData; 56 const String16 m_auxData;
57 std::unordered_set<int> m_reportedSessionIds; 57 std::unordered_set<int> m_reportedSessionIds;
58 std::unique_ptr<InjectedScript> m_injectedScript; 58 std::unordered_map<int, std::unique_ptr<InjectedScript>> m_injectedScripts;
59 59
60 DISALLOW_COPY_AND_ASSIGN(InspectedContext); 60 DISALLOW_COPY_AND_ASSIGN(InspectedContext);
61 }; 61 };
62 62
63 } // namespace v8_inspector 63 } // namespace v8_inspector
64 64
65 #endif // V8_INSPECTOR_INSPECTEDCONTEXT_H_ 65 #endif // V8_INSPECTOR_INSPECTEDCONTEXT_H_
OLDNEW
« no previous file with comments | « src/inspector/injected-script.cc ('k') | src/inspector/inspected-context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698