Skip to content
This repository was archived by the owner on Jun 3, 2021. It is now read-only.

Commit f20382a

Browse files
miominYorkShen
authored andcommitted
* [android] Fix windmill container to debug weex page (#2077)
* * [android] Rename WMLBridge to WeexBridge * * [android] Fix windmill container to debug weex page
1 parent 709e948 commit f20382a

File tree

4 files changed

+9
-23
lines changed

4 files changed

+9
-23
lines changed
2.06 MB
Binary file not shown.
0 Bytes
Binary file not shown.

weex_core/Source/android/wrap/wml_bridge.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ namespace WeexCore {
184184

185185
WMLBridge* WMLBridge::g_instance = nullptr;
186186

187-
const char kWMLBridgeClassPath[] = "com/taobao/windmill/bridge/WMLBridge";
187+
const char kWMLBridgeClassPath[] = "com/taobao/windmill/bundle/bridge/WeexBridge";
188188
jclass g_WMLBridge_clazz = nullptr;
189189

190190
static JNINativeMethod gWMMethods[] = {

weex_core/Source/core/bridge/script/core_side_in_script.cpp

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -50,32 +50,18 @@ void CoreSideInScript::CallNative(const char *page_id, const char *task,
5050
const char *callback) {
5151
if (page_id == nullptr || task == nullptr) return;
5252

53-
// WeexCoreManager::Instance()->script_thread()->message_loop()->PostTask(
54-
// weex::base::MakeCopyable(
55-
// [pageId = std::unique_ptr<char[]>(copyStr(page_id)),
56-
// taskS = std::unique_ptr<char[]>(copyStr(task)),
57-
// callbackS = std::unique_ptr<char[]>(copyStr(callback))] {
58-
// if (strcmp(taskS.get(),
59-
// "[{\"module\":\"dom\",\"method\":\"createFinish\","
60-
// "\"args\":[]}]") == 0) {
61-
// RenderManager::GetInstance()->CreateFinish(pageId.get()) ? 0 :
62-
// -1;
63-
// } else {
64-
// WeexCoreManager::Instance()
65-
// ->getPlatformBridge()
66-
// ->platform_side()
67-
// ->CallNative(pageId.get(), taskS.get(), callbackS.get());
68-
// }
69-
// }));
70-
if (strcmp(task,
71-
"[{\"module\":\"dom\",\"method\":\"createFinish\","
72-
"\"args\":[]}]") == 0) {
73-
RenderManager::GetInstance()->CreateFinish(page_id);
74-
} else {
53+
std::string task_str(task);
54+
std::string target_str("[{\"module\":\"dom\",\"method\":\"createFinish\","
55+
"\"args\":[]}]");
56+
std::string::size_type idx = task_str.find(target_str);
57+
58+
if(idx == std::string::npos) {
7559
WeexCoreManager::Instance()
7660
->getPlatformBridge()
7761
->platform_side()
7862
->CallNative(page_id, task, callback);
63+
} else {
64+
RenderManager::GetInstance()->CreateFinish(page_id);
7965
}
8066
}
8167

0 commit comments

Comments
 (0)