@@ -42,10 +42,10 @@ index 06f0961e122f326e41610dd7a1b32fa752f0c68f..a041189f79cea5b59e1792b79c1348e3
42
42
// another SiteInstance for the same site.
43
43
void RegisterSiteInstance(SiteInstanceImpl* site_instance);
44
44
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
45
- index 90a4052c97696d85d6fbe3274b999b09fb4015c0..fb30f403dafe1e88ca556849ef43b17ae934fd5c 100644
45
+ index 90a4052c97696d85d6fbe3274b999b09fb4015c0..c0be3721db3be1c9da89f227ed4cfb5a36201f30 100644
46
46
--- a/content/browser/frame_host/navigation_request.cc
47
47
+++ b/content/browser/frame_host/navigation_request.cc
48
- @@ -1406,6 +1406,24 @@ void NavigationRequest::BeginNavigation() {
48
+ @@ -1406,6 +1406,21 @@ void NavigationRequest::BeginNavigation() {
49
49
// it immediately.
50
50
EnterChildTraceEvent("ResponseStarted", this);
51
51
@@ -61,15 +61,46 @@ index 90a4052c97696d85d6fbe3274b999b09fb4015c0..fb30f403dafe1e88ca556849ef43b17a
61
61
+ // (request->state() >= NavigationRequest::WILL_PROCESS_RESPONSE &&
62
62
+ // !speculative_render_frame_host_);
63
63
+ //
64
- + // Hence this call is necesary before the call to GetFrameHostForNavigation. Also
65
- + // the state_ here is anyway going to end up being READY_TO_COMMIT because of
66
- + // ReadyToCommitNavigation a few lines later, so will not affect normal chromium
67
- + // request cycle.
68
- + state_ = READY_TO_COMMIT;
64
+ + // Hence this call is necesary before the call to GetFrameHostForNavigation.
65
+ + SetState(REUSE_SITE_INSTANCE);
69
66
+
70
67
// Select an appropriate RenderFrameHost.
71
68
render_frame_host_ =
72
69
frame_tree_node_->render_manager()->GetFrameHostForNavigation(this);
70
+ @@ -4761,13 +4776,15 @@ void NavigationRequest::CheckStateTransition(NavigationState state) const {
71
+ {WAITING_FOR_RENDERER_RESPONSE, {WILL_START_NAVIGATION}},
72
+ {WILL_START_NAVIGATION, {WILL_START_REQUEST, WILL_FAIL_REQUEST}},
73
+ {WILL_START_REQUEST,
74
+ - {WILL_REDIRECT_REQUEST, WILL_PROCESS_RESPONSE, READY_TO_COMMIT,
75
+ - DID_COMMIT, CANCELING, WILL_FAIL_REQUEST, DID_COMMIT_ERROR_PAGE}},
76
+ + {WILL_REDIRECT_REQUEST, WILL_PROCESS_RESPONSE, REUSE_SITE_INSTANCE,
77
+ + READY_TO_COMMIT, DID_COMMIT, CANCELING, WILL_FAIL_REQUEST,
78
+ + DID_COMMIT_ERROR_PAGE}},
79
+ {WILL_REDIRECT_REQUEST,
80
+ {WILL_REDIRECT_REQUEST, WILL_PROCESS_RESPONSE, CANCELING,
81
+ WILL_FAIL_REQUEST}},
82
+ {WILL_PROCESS_RESPONSE,
83
+ - {READY_TO_COMMIT, CANCELING, WILL_FAIL_REQUEST}},
84
+ + {REUSE_SITE_INSTANCE, READY_TO_COMMIT, CANCELING, WILL_FAIL_REQUEST}},
85
+ + {REUSE_SITE_INSTANCE, {READY_TO_COMMIT}},
86
+ {READY_TO_COMMIT, {NOT_STARTED, DID_COMMIT, DID_COMMIT_ERROR_PAGE}},
87
+ {DID_COMMIT, {}},
88
+ {CANCELING, {READY_TO_COMMIT, WILL_FAIL_REQUEST}},
89
+ diff --git a/content/browser/frame_host/navigation_request.h b/content/browser/frame_host/navigation_request.h
90
+ index cb004ae1ebd76210f826b988c439f71e221b1ad4..50b6381ae4d9d89658c99c6e8a532d0d065c8dc0 100644
91
+ --- a/content/browser/frame_host/navigation_request.h
92
+ +++ b/content/browser/frame_host/navigation_request.h
93
+ @@ -142,6 +142,10 @@ class CONTENT_EXPORT NavigationRequest
94
+ // asynchronous.
95
+ WILL_PROCESS_RESPONSE,
96
+
97
+ + // Electron: state that is between than WILL_PROCESS_RESPONSE and
98
+ + // READY_TO_COMMIT to force reuse the same site instance.
99
+ + REUSE_SITE_INSTANCE,
100
+ +
101
+ // The response started on the IO thread and is ready to be committed.
102
+ READY_TO_COMMIT,
103
+
73
104
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
74
105
index b9eedf1568e9c2f33fd01a31ba2f0037fde96570..8dc7b5a8351c5901001f1d6f1b44916db5c80ec7 100644
75
106
--- a/content/browser/frame_host/render_frame_host_manager.cc
0 commit comments