Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(724)

Unified Diff: content/browser/devtools/render_frame_devtools_agent_host.h

Issue 2927983004: [DevTools] Rework RFDTAH navigation tracking with browser side navigation (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/devtools/render_frame_devtools_agent_host.h
diff --git a/content/browser/devtools/render_frame_devtools_agent_host.h b/content/browser/devtools/render_frame_devtools_agent_host.h
index 82ef5c6f06a9fdea18c7d6f4ec7055d93eac742e..fd400d7a0bc99d03041572334df16d09f28acad0 100644
--- a/content/browser/devtools/render_frame_devtools_agent_host.h
+++ b/content/browser/devtools/render_frame_devtools_agent_host.h
@@ -51,7 +51,6 @@ class CONTENT_EXPORT RenderFrameDevToolsAgentHost
RenderFrameHost* current);
static void OnBeforeNavigation(RenderFrameHost* current,
RenderFrameHost* pending);
- static void OnBeforeNavigation(NavigationHandle* navigation_handle);
static void OnFailedNavigation(RenderFrameHost* host,
const CommonNavigationParams& common_params,
const BeginNavigationParams& begin_params,
@@ -100,6 +99,7 @@ class CONTENT_EXPORT RenderFrameDevToolsAgentHost
const std::string& message) override;
// WebContentsObserver overrides.
+ void DidStartNavigation(NavigationHandle* navigation_handle) override;
void ReadyToCommitNavigation(NavigationHandle* navigation_handle) override;
void DidFinishNavigation(NavigationHandle* navigation_handle) override;
void RenderFrameHostChanged(RenderFrameHost* old_host,
@@ -117,12 +117,6 @@ class CONTENT_EXPORT RenderFrameDevToolsAgentHost
void AboutToNavigateRenderFrame(RenderFrameHost* old_host,
RenderFrameHost* new_host);
- void AboutToNavigate(NavigationHandle* navigation_handle);
- void OnFailedNavigation(const CommonNavigationParams& common_params,
- const BeginNavigationParams& begin_params,
- net::Error error_code);
-
- void DispatchBufferedProtocolMessagesIfNecessary();
void SetPending(RenderFrameHostImpl* host);
void CommitPending();
@@ -143,6 +137,11 @@ class CONTENT_EXPORT RenderFrameDevToolsAgentHost
void DestroyOnRenderFrameGone();
bool CheckConsistency();
+ void UpdateFrameHost(RenderFrameHostImpl* frame_host);
+ void MaybeReattachToRenderFrame();
+ void SendMessageFromProcessor(int session_id, const std::string& message);
+ void GrantPolicy(RenderFrameHostImpl* host);
+ void RevokePolicy(RenderFrameHostImpl* host);
#if defined(OS_ANDROID)
device::mojom::WakeLock* GetWakeLock();
@@ -168,19 +167,25 @@ class CONTENT_EXPORT RenderFrameDevToolsAgentHost
// PlzNavigate
- // Handle that caused the setting of pending_.
- NavigationHandle* pending_handle_;
-
- // List of handles currently navigating.
- std::set<NavigationHandle*> navigating_handles_;
-
- struct PendingMessage {
+ // The active host we are talking to.
+ RenderFrameHostImpl* frame_host_ = nullptr;
+ struct Message {
int session_id;
+ int call_id;
caseq 2017/06/10 00:02:46 I don't think you actually need it.
dgozman 2017/06/10 01:36:35 Done.
std::string method;
std::string message;
};
- // <call_id> -> PendingMessage
- std::map<int, PendingMessage> in_navigation_protocol_message_buffer_;
+ // Chunk processor's state cookie always corresponds to a state before
+ // any of the suspended or waiting for response messages have been handled.
+ DevToolsMessageChunkProcessor chunk_processor_;
+ int suspended_count_ = 0;
+ bool render_frame_alive_ = false;
+ // These messages were sent before suspending, but their result have not been
+ // received yet, and state cookie has not been updated.
+ std::map<int, Message> waiting_for_response_messages_;
+ // These messages were queued after suspending, not sent to the agent,
+ // and will be sent after resuming.
+ std::map<int, Message> suspended_messages_;
// The FrameTreeNode associated with this agent.
FrameTreeNode* frame_tree_node_;

Powered by Google App Engine
This is Rietveld 408576698