Skip to content

Commit 0acdc9b

Browse files
committed
using v8-inspector from v8 5.5
1 parent eb8516f commit 0acdc9b

175 files changed

Lines changed: 14669 additions & 16479 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

runtime/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,15 @@ model {
221221
cppFlags.addAll(["-I${file("src/main/jni")}".toString(),
222222
"-I${file("src/main/jni/include")}".toString(),
223223
"-I${file("src/main/jni/v8_inspector/")}".toString(),
224-
"-I${file("src/main/jni/v8_inspector/platform/inspector_protocol/")}".toString(),
224+
//"-I${file("src/main/jni/v8_inspector/platform/inspector_protocol/")}".toString(),
225+
//"-I${file("src/main/jni/v8_inspector/protocol/")}".toString(),
225226
])
226227

227228
CFlags.addAll(["-I${file("src/main/jni")}".toString(),
228229
"-I${file("src/main/jni/include")}".toString(),
229230
"-I${file("src/main/jni/v8_inspector")}".toString(),
230-
"-I${file("src/main/jni/v8_inspector/platform/inspector_protocol/")}".toString(),
231+
//"-I${file("src/main/jni/v8_inspector/platform/inspector_protocol/")}".toString(),
232+
//"-I${file("src/main/jni/v8_inspector/protocol/")}".toString(),
231233
])
232234

233235
cppFlags.addAll(["-std=c++11", "-fexceptions", "-fno-builtin-stpcpy", "-DHAVE_INSPECTOR"]) //, "-DV8_INSPECTOR_USE_STL=1", "-D__GXX_EXPERIMENTAL_CXX0X__=1"

runtime/src/main/jni/JsV8InspectorClient.cpp

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//#include "NativeScriptAssert.h"
77
#include <sstream>
88
#include <assert.h>
9-
#include "v8_inspector/platform/v8_inspector/String16STL.h"
109
#include "Runtime.h"
10+
#include "src/inspector/string-16.h"
1111

1212
using namespace std;
1313
using namespace tns;
@@ -37,7 +37,7 @@ void JsV8InspectorClient::connect(jobject connection)
3737
v8::Isolate::Scope isolate_scope(isolate_);
3838
v8::HandleScope handleScope(isolate_);
3939

40-
session_ = inspector_->connect(1, this, nullptr);
40+
//session_ = inspector_->connect(1, this, nullptr);
4141

4242
JEnv env;
4343
this->connection = env.NewGlobalRef(connection);
@@ -61,31 +61,31 @@ void JsV8InspectorClient::dispatchMessage(const std::string &message)
6161
v8::HandleScope handleScope(isolate_);
6262

6363
assert(session_ != nullptr);
64-
const String16 protocolMessage(message.c_str());
65-
session_->dispatchProtocolMessage(protocolMessage);
64+
//const String16 protocolMessage(message.c_str());
65+
//session_->dispatchProtocolMessage(protocolMessage);
6666
}
6767

68-
void JsV8InspectorClient::sendProtocolResponse(int callId, const String16 &message)
69-
{
70-
sendProtocolNotification(message);
71-
}
72-
73-
void JsV8InspectorClient::sendProtocolNotification(const String16 &message)
74-
{
75-
if (inspectorClass == nullptr || this->connection == nullptr)
76-
{
77-
return;
78-
}
79-
80-
81-
JEnv env;
82-
JniLocalRef string(env.NewStringUTF(message.utf8().c_str()));
83-
env.CallStaticVoidMethod(inspectorClass, sendMethod, this->connection, (jstring) string);
84-
}
85-
86-
void JsV8InspectorClient::flushProtocolNotifications()
87-
{
88-
}
68+
//void JsV8InspectorClient::sendProtocolResponse(int callId, const String16 &message)
69+
//{
70+
// sendProtocolNotification(message);
71+
//}
72+
//
73+
//void JsV8InspectorClient::sendProtocolNotification(const String16 &message)
74+
//{
75+
// if (inspectorClass == nullptr || this->connection == nullptr)
76+
// {
77+
// return;
78+
// }
79+
//
80+
//
81+
// JEnv env;
82+
// JniLocalRef string(env.NewStringUTF(message.utf8().c_str()));
83+
// env.CallStaticVoidMethod(inspectorClass, sendMethod, this->connection, (jstring) string);
84+
//}
85+
//
86+
//void JsV8InspectorClient::flushProtocolNotifications()
87+
//{
88+
//}
8989

9090
void JsV8InspectorClient::init()
9191
{
@@ -98,7 +98,7 @@ void JsV8InspectorClient::init()
9898
v8::HandleScope handleScope(isolate_);
9999

100100
inspector_ = V8Inspector::create(isolate_, this);
101-
inspector_->contextCreated(v8_inspector::V8ContextInfo(isolate_->GetCurrentContext(), 1, "{N} Context"));
101+
//inspector_->contextCreated(v8_inspector::V8ContextInfo(isolate_->GetCurrentContext(), 1, "{N} Context"));
102102
}
103103

104104
JsV8InspectorClient *JsV8InspectorClient::GetInstance()

runtime/src/main/jni/JsV8InspectorClient.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@
55
#include "v8.h"
66
#include "v8-debug.h"
77
#include "JEnv.h"
8-
#include "v8_inspector/platform/v8_inspector/public/V8InspectorClient.h"
9-
#include "v8_inspector/platform/v8_inspector/public/V8InspectorSession.h"
10-
#include "v8_inspector/platform/v8_inspector/public/V8Inspector.h"
8+
#include "src/inspector/v8-inspector-impl.h"
9+
#include "src/inspector/v8-inspector-session-impl.h"
10+
#include "v8-inspector.h"
11+
#include "src/inspector/protocol/Forward.h"
12+
#include "src/inspector/string-16.h"
1113

12-
using namespace v8_inspector;
1314

15+
using namespace v8_inspector;
1416

1517
namespace tns
1618
{
17-
class JsV8InspectorClient : V8InspectorClient, blink::protocol::FrontendChannel
19+
class JsV8InspectorClient : V8InspectorClient //, InspectorClientImpl::FrontendChannel
1820
{
1921
public:
2022
static JsV8InspectorClient* GetInstance();
@@ -23,9 +25,9 @@ namespace tns
2325
void connect(jobject connection);
2426
void disconnect();
2527
void dispatchMessage(const std::string& message);
26-
void sendProtocolResponse(int callId, const String16& message) override;
27-
void sendProtocolNotification(const String16& message) override;
28-
void flushProtocolNotifications() override;
28+
//void sendProtocolResponse(int callId, const String16& message) override;
29+
//void sendProtocolNotification(const String16& message) override;
30+
//void flushProtocolNotifications() override;
2931

3032
private:
3133
JsV8InspectorClient(v8::Isolate *isolate);
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// This file is generated
2+
3+
// Copyright (c) 2016 The Chromium Authors. All rights reserved.
4+
// Use of this source code is governed by a BSD-style license that can be
5+
// found in the LICENSE file.
6+
7+
#ifndef v8_inspector_protocol_Debugger_api_h
8+
#define v8_inspector_protocol_Debugger_api_h
9+
10+
#include "v8-inspector.h"
11+
12+
namespace v8_inspector {
13+
namespace protocol {
14+
namespace Debugger {
15+
namespace API {
16+
17+
// ------------- Enums.
18+
19+
namespace Paused {
20+
namespace ReasonEnum {
21+
V8_EXPORT extern const char* XHR;
22+
V8_EXPORT extern const char* DOM;
23+
V8_EXPORT extern const char* EventListener;
24+
V8_EXPORT extern const char* Exception;
25+
V8_EXPORT extern const char* Assert;
26+
V8_EXPORT extern const char* DebugCommand;
27+
V8_EXPORT extern const char* PromiseRejection;
28+
V8_EXPORT extern const char* Other;
29+
} // ReasonEnum
30+
} // Paused
31+
32+
// ------------- Types.
33+
34+
class V8_EXPORT SearchMatch {
35+
public:
36+
virtual std::unique_ptr<StringBuffer> toJSONString() const = 0;
37+
virtual ~SearchMatch() { }
38+
static std::unique_ptr<protocol::Debugger::API::SearchMatch> fromJSONString(const StringView& json);
39+
};
40+
41+
} // namespace API
42+
} // namespace Debugger
43+
} // namespace v8_inspector
44+
} // namespace protocol
45+
46+
#endif // !defined(v8_inspector_protocol_Debugger_api_h)

runtime/src/main/jni/v8_inspector/platform/v8_inspector/public/protocol/Runtime.h renamed to runtime/src/main/jni/include/inspector/Runtime.h

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44
// Use of this source code is governed by a BSD-style license that can be
55
// found in the LICENSE file.
66

7-
#ifndef protocol_Runtime_api_h
8-
#define protocol_Runtime_api_h
7+
#ifndef v8_inspector_protocol_Runtime_api_h
8+
#define v8_inspector_protocol_Runtime_api_h
99

10-
#include "platform/PlatformExport.h"
11-
#include "platform/inspector_protocol/InspectorProtocol.h"
10+
#include "v8-inspector.h"
1211

13-
namespace blink {
12+
namespace v8_inspector {
1413
namespace protocol {
1514
namespace Runtime {
1615
namespace API {
@@ -19,23 +18,23 @@ namespace API {
1918

2019
// ------------- Types.
2120

22-
class PLATFORM_EXPORT RemoteObject {
21+
class V8_EXPORT RemoteObject {
2322
public:
24-
virtual String16 toJSONString() const = 0;
23+
virtual std::unique_ptr<StringBuffer> toJSONString() const = 0;
2524
virtual ~RemoteObject() { }
26-
static std::unique_ptr<protocol::Runtime::API::RemoteObject> fromJSONString(const String16& json);
25+
static std::unique_ptr<protocol::Runtime::API::RemoteObject> fromJSONString(const StringView& json);
2726
};
2827

29-
class PLATFORM_EXPORT StackTrace {
28+
class V8_EXPORT StackTrace {
3029
public:
31-
virtual String16 toJSONString() const = 0;
30+
virtual std::unique_ptr<StringBuffer> toJSONString() const = 0;
3231
virtual ~StackTrace() { }
33-
static std::unique_ptr<protocol::Runtime::API::StackTrace> fromJSONString(const String16& json);
32+
static std::unique_ptr<protocol::Runtime::API::StackTrace> fromJSONString(const StringView& json);
3433
};
3534

3635
} // namespace API
3736
} // namespace Runtime
37+
} // namespace v8_inspector
3838
} // namespace protocol
39-
} // namespace blink
4039

41-
#endif // !defined(protocol_Runtime_api_h)
40+
#endif // !defined(v8_inspector_protocol_Runtime_api_h)

runtime/src/main/jni/v8_inspector/platform/v8_inspector/public/protocol/Schema.h renamed to runtime/src/main/jni/include/inspector/Schema.h

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44
// Use of this source code is governed by a BSD-style license that can be
55
// found in the LICENSE file.
66

7-
#ifndef protocol_Schema_api_h
8-
#define protocol_Schema_api_h
7+
#ifndef v8_inspector_protocol_Schema_api_h
8+
#define v8_inspector_protocol_Schema_api_h
99

10-
#include "platform/PlatformExport.h"
11-
#include "platform/inspector_protocol/InspectorProtocol.h"
10+
#include "v8-inspector.h"
1211

13-
namespace blink {
12+
namespace v8_inspector {
1413
namespace protocol {
1514
namespace Schema {
1615
namespace API {
@@ -19,16 +18,16 @@ namespace API {
1918

2019
// ------------- Types.
2120

22-
class PLATFORM_EXPORT Domain {
21+
class V8_EXPORT Domain {
2322
public:
24-
virtual String16 toJSONString() const = 0;
23+
virtual std::unique_ptr<StringBuffer> toJSONString() const = 0;
2524
virtual ~Domain() { }
26-
static std::unique_ptr<protocol::Schema::API::Domain> fromJSONString(const String16& json);
25+
static std::unique_ptr<protocol::Schema::API::Domain> fromJSONString(const StringView& json);
2726
};
2827

2928
} // namespace API
3029
} // namespace Schema
30+
} // namespace v8_inspector
3131
} // namespace protocol
32-
} // namespace blink
3332

34-
#endif // !defined(protocol_Schema_api_h)
33+
#endif // !defined(v8_inspector_protocol_Schema_api_h)

runtime/src/main/jni/v8_inspector/platform/PlatformExport.h

Lines changed: 0 additions & 66 deletions
This file was deleted.

runtime/src/main/jni/v8_inspector/platform/v8_inspector/Atomics.h

Lines changed: 0 additions & 29 deletions
This file was deleted.

runtime/src/main/jni/v8_inspector/platform/v8_inspector/DebuggerScript.h

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)