Skip to content

Commit 07b7cbd

Browse files
author
david
committed
feat: add dart_isolate_context.cc
1 parent 3c35093 commit 07b7cbd

15 files changed

+147
-200
lines changed

bridge/CMakeLists.txt

+11-11
Original file line numberDiff line numberDiff line change
@@ -85,23 +85,23 @@ if (DEFINED PLATFORM)
8585
endif()
8686

8787
list(APPEND BRIDGE_SOURCE
88-
# foundation/logging.cc
88+
foundation/logging.cc
8989
foundation/native_string.cc
9090
# foundation/ui_task_queue.cc
91-
# foundation/shared_ui_command.cc
91+
foundation/shared_ui_command.cc
9292
# foundation/inspector_task_queue.cc
9393
# foundation/task_queue.cc
9494
foundation/string_view.cc
9595
# foundation/native_value.cc
9696
# foundation/native_type.cc
9797
# foundation/stop_watch.cc
9898
# foundation/profiler.cc
99-
# foundation/dart_readable.cc
100-
# foundation/ui_command_buffer.cc
101-
# foundation/ui_command_strategy.cc
99+
foundation/dart_readable.cc
100+
foundation/ui_command_buffer.cc
101+
foundation/ui_command_strategy.cc
102102
# polyfill/dist/polyfill.cc
103-
# multiple_threading/dispatcher.cc
104-
# multiple_threading/looper.cc
103+
multiple_threading/dispatcher.cc
104+
multiple_threading/looper.cc
105105
${CMAKE_CURRENT_LIST_DIR}/third_party/dart/include/dart_api_dl.c
106106
)
107107

@@ -433,7 +433,7 @@ elseif ($ENV{WEBF_JS_ENGINE} MATCHES "v8")
433433
bindings/v8/wrapper_type_info.cc
434434
bindings/v8/v8_interface_bridge_base.cc
435435
bindings/v8/v8_initializer.cc
436-
bindings/v8/platform/script_state.cc
436+
# bindings/v8/platform/script_state.cc
437437
bindings/v8/platform/scoped_persistent.h
438438
bindings/v8/platform/v8_per_context_data.cc
439439
bindings/v8/platform/v8_per_isolate_data.cc
@@ -537,10 +537,10 @@ list(APPEND BRIDGE_SOURCE
537537
# Core sources
538538
webf_bridge.cc
539539
# core/api/api.cc
540-
# core/executing_context.cc
540+
core/executing_context.cc
541541
# core/script_forbidden_scope.cc
542-
# core/script_state.cc
543-
# core/page.cc
542+
core/script_state.cc
543+
core/page.cc
544544
core/dart_methods.cc
545545
core/dart_isolate_context.cc
546546
# core/dart_context_data.cc

bridge/bindings/v8/platform/script_state_test.cc

-13
This file was deleted.

bridge/bindings/v8/platform/v8_per_context_data.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//#include "base/memory/ptr_util.h"
1313
//#include "components/crash/core/common/crash_key.h"
1414
//#include "third_party/blink/renderer/platform/bindings/origin_trial_features.h"
15-
#include "bindings/v8/platform/script_state.h"
15+
//#include "bindings/v8/platform/script_state.h"
1616
//#include "third_party/blink/renderer/platform/bindings/v8_binding.h"
1717
//#include "third_party/blink/renderer/platform/bindings/v8_object_constructor.h"
1818
#include "bindings/v8/wrapper_type_info.h"

bridge/bindings/v8/platform/v8_per_isolate_data.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
//#include "bindings/v8/platform/dom_data_store.h"
2222
//#include "bindings/v8/platform/script_forbidden_scope.h"
2323
//#include "bindings/v8/platform/script_regexp.h"
24-
#include "bindings/v8/platform/script_state.h"
24+
//#include "bindings/v8/platform/script_state.h"
2525
//#include "bindings/v8/platform/thread_debugger.h"
2626
//#include "bindings/v8/platform/v8_binding.h"
2727
//#include "bindings/v8/platform/v8_histogram_accumulator.h"

bridge/core/dart_isolate_context.cc

+11-11
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
#include <unordered_set>
1010
#include "dart_isolate_context.h"
1111
//#include "event_factory.h"
12-
#include "html_element_factory.h"
13-
//#include "names_installer.h"
14-
//#include "page.h"
15-
#include "svg_element_factory.h"
12+
//#include "html_element_factory.h"
13+
#include "names_installer.h"
14+
#include "page.h"
15+
//#include "svg_element_factory.h"
1616

1717
namespace webf {
1818

@@ -82,7 +82,7 @@ void InitializeBuiltInStrings(JSContext* ctx) {
8282
#elif WEBF_V8_JS_ENGINE
8383
void InitializeBuiltInStrings(v8::Isolate* isolate) {
8484
if (!is_name_installed_) {
85-
names_installer::Init(isolate);
85+
// names_installer::Init(isolate);
8686
is_name_installed_ = true;
8787
}
8888
}
@@ -119,8 +119,8 @@ void DartIsolateContext::FinalizeJSRuntime() {
119119

120120
// Prebuilt strings stored in JSRuntime. Only needs to dispose when runtime disposed.
121121
// names_installer::Dispose();
122-
HTMLElementFactory::Dispose();
123-
SVGElementFactory::Dispose();
122+
// HTMLElementFactory::Dispose();
123+
// SVGElementFactory::Dispose();
124124
// EventFactory::Dispose();
125125

126126
#if WEBF_QUICKJS_JS_ENGINE
@@ -174,11 +174,11 @@ void DartIsolateContext::InitializeNewPageInJSThread(PageGroup* page_group,
174174
int32_t sync_buffer_size,
175175
Dart_Handle dart_handle,
176176
AllocateNewPageCallback result_callback) {
177-
dart_isolate_context->profiler()->StartTrackInitialize();
177+
// dart_isolate_context->profiler()->StartTrackInitialize();
178178
DartIsolateContext::InitializeJSRuntime();
179179
auto* page = new WebFPage(dart_isolate_context, true, sync_buffer_size, page_context_id, nullptr);
180180

181-
dart_isolate_context->profiler()->FinishTrackInitialize();
181+
// dart_isolate_context->profiler()->FinishTrackInitialize();
182182

183183
dart_isolate_context->dispatcher_->PostToDart(true, HandleNewPageResult, page_group, dart_handle, result_callback,
184184
page);
@@ -229,9 +229,9 @@ void* DartIsolateContext::AddNewPage(double thread_identity,
229229
}
230230

231231
void* DartIsolateContext::AddNewPageSync(double thread_identity) {
232-
profiler()->StartTrackSteps("WebFPage::Initialize");
232+
// profiler()->StartTrackSteps("WebFPage::Initialize");
233233
auto page = std::make_unique<WebFPage>(this, false, 0, thread_identity, nullptr);
234-
profiler()->FinishTrackSteps();
234+
// profiler()->FinishTrackSteps();
235235

236236
void* p = page.get();
237237
pages_in_ui_thread_.emplace(std::move(page));

0 commit comments

Comments
 (0)