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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/InspectedContext.h

Issue 1873533002: [DevTools] Force context creation when runtime is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more tests Created 4 years, 8 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium 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 InspectedContext_h 5 #ifndef InspectedContext_h
6 #define InspectedContext_h 6 #define InspectedContext_h
7 7
8 #include "platform/inspector_protocol/Allocator.h" 8 #include "platform/inspector_protocol/Allocator.h"
9 #include "platform/inspector_protocol/Collections.h" 9 #include "platform/inspector_protocol/Collections.h"
10 #include "platform/inspector_protocol/String16.h" 10 #include "platform/inspector_protocol/String16.h"
11 #include <v8.h> 11 #include <v8.h>
12 12
13 namespace blink { 13 namespace blink {
14 14
15 class InjectedScript; 15 class InjectedScript;
16 class InjectedScriptHost; 16 class InjectedScriptHost;
17 class V8ContextInfo; 17 class V8ContextInfo;
18 class V8DebuggerImpl; 18 class V8DebuggerImpl;
19 19
20 class InspectedContext { 20 class InspectedContext {
21 PROTOCOL_DISALLOW_COPY(InspectedContext); 21 PROTOCOL_DISALLOW_COPY(InspectedContext);
22 public: 22 public:
23 ~InspectedContext(); 23 ~InspectedContext();
24 24
25 v8::Local<v8::Context> context() const; 25 v8::Local<v8::Context> context() const;
26 int contextId() const { return m_contextId; } 26 int contextId() const { return m_contextId; }
27 bool isMainInGroup() const { return m_isMainInGroup; }
28 bool isDefault() const { return m_isDefault; } 27 bool isDefault() const { return m_isDefault; }
29 String16 origin() const { return m_origin; } 28 String16 origin() const { return m_origin; }
30 String16 humanReadableName() const { return m_humanReadableName; } 29 String16 humanReadableName() const { return m_humanReadableName; }
31 String16 frameId() const { return m_frameId; } 30 String16 frameId() const { return m_frameId; }
32 31
33 bool isReported() const { return m_reported; } 32 bool isReported() const { return m_reported; }
34 void setReported(bool reported) { m_reported = reported; } 33 void setReported(bool reported) { m_reported = reported; }
35 34
36 v8::Isolate* isolate() const; 35 v8::Isolate* isolate() const;
37 V8DebuggerImpl* debugger() const { return m_debugger; } 36 V8DebuggerImpl* debugger() const { return m_debugger; }
38 37
39 InjectedScript* getInjectedScript() { return m_injectedScript.get(); } 38 InjectedScript* getInjectedScript() { return m_injectedScript.get(); }
40 void createInjectedScript(InjectedScriptHost*); 39 void createInjectedScript(InjectedScriptHost*);
41 void discardInjectedScript(); 40 void discardInjectedScript();
42 41
43 private: 42 private:
44 friend class V8DebuggerImpl; 43 friend class V8DebuggerImpl;
45 InspectedContext(V8DebuggerImpl*, const V8ContextInfo&, int contextId); 44 InspectedContext(V8DebuggerImpl*, const V8ContextInfo&, int contextId);
46 static void weakCallback(const v8::WeakCallbackInfo<InspectedContext>&); 45 static void weakCallback(const v8::WeakCallbackInfo<InspectedContext>&);
47 46
48 V8DebuggerImpl* m_debugger; 47 V8DebuggerImpl* m_debugger;
49 v8::Global<v8::Context> m_context; 48 v8::Global<v8::Context> m_context;
50 int m_contextId; 49 int m_contextId;
51 int m_contextGroupId; 50 int m_contextGroupId;
52 bool m_isMainInGroup;
53 bool m_isDefault; 51 bool m_isDefault;
54 const String16 m_origin; 52 const String16 m_origin;
55 const String16 m_humanReadableName; 53 const String16 m_humanReadableName;
56 const String16 m_frameId; 54 const String16 m_frameId;
57 bool m_reported; 55 bool m_reported;
58 OwnPtr<InjectedScript> m_injectedScript; 56 OwnPtr<InjectedScript> m_injectedScript;
59 }; 57 };
60 58
61 } // namespace blink 59 } // namespace blink
62 60
63 #endif 61 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698