1 // Copyright 2020 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef V8_INSPECTOR_V8_DEBUGGER_ID_H_ 6 #define V8_INSPECTOR_V8_DEBUGGER_ID_H_ 7 8 #include <utility> 9 10 #include "include/v8-inspector.h" 11 #include "src/base/macros.h" 12 #include "src/inspector/protocol/Forward.h" 13 14 namespace v8_inspector { 15 class V8InspectorImpl; 16 17 namespace internal { 18 19 class V8DebuggerId { 20 public: 21 V8DebuggerId() = default; 22 explicit V8DebuggerId(std::pair<int64_t, int64_t>); 23 explicit V8DebuggerId(const String16&); 24 V8DebuggerId(const V8DebuggerId&) V8_NOEXCEPT = default; 25 V8DebuggerId& operator=(const V8DebuggerId&) V8_NOEXCEPT = default; 26 27 static V8DebuggerId generate(V8InspectorImpl*); 28 toV8DebuggerId()29 v8_inspector::V8DebuggerId toV8DebuggerId() const { return m_debugger_id; } 30 String16 toString() const; 31 bool isValid() const; 32 std::pair<int64_t, int64_t> pair() const; 33 34 private: 35 v8_inspector::V8DebuggerId m_debugger_id; 36 }; 37 38 } // namespace internal 39 } // namespace v8_inspector 40 41 #endif // V8_INSPECTOR_V8_DEBUGGER_ID_H_ 42