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

Unified Diff: headless/app/shell_navigation_request.h

Issue 2687083002: Headless: make URLRequestDispatcher aware of navigations (Closed)
Patch Set: Pulled ShellNavigationRequest out into a separate file Created 3 years, 10 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: headless/app/shell_navigation_request.h
diff --git a/headless/app/shell_navigation_request.h b/headless/app/shell_navigation_request.h
new file mode 100644
index 0000000000000000000000000000000000000000..9fec33b73dd950bd472747c5b536d1a4a4796e9c
--- /dev/null
+++ b/headless/app/shell_navigation_request.h
@@ -0,0 +1,41 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef HEADLESS_PUBLIC_UTIL_HTTP_URL_FETCHER_H_
+#define HEADLESS_PUBLIC_UTIL_HTTP_URL_FETCHER_H_
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "headless/public/devtools/domains/page.h"
+#include "headless/public/util/navigation_request.h"
+
+namespace headless {
+class HeadlessShell;
+
+// Used in deterministic mode to make sure navigations and resource requests
+// complete in the order requested.
+class ShellNavigationRequest : public NavigationRequest {
+ public:
+ ShellNavigationRequest(base::WeakPtr<HeadlessShell> headless_shell,
+ const page::NavigationRequestedParams& params);
+
+ ~ShellNavigationRequest() override;
+
+ void StartProcessing(base::Closure done_callback) override;
+
+ // Note the navigation likely isn't done when this is called, however we
+ // expect it will have been committed and the initial resource load requested.
+ static void ProcessNavigationResult(
Sami 2017/02/09 15:12:52 nit: Make private?
alex clarke (OOO till 29th) 2017/02/09 15:55:45 Done.
+ base::Closure done_callback,
+ std::unique_ptr<page::ProcessNavigationResult>);
+
+ private:
+ base::WeakPtr<HeadlessShell> headless_shell_;
+ int navigation_id_;
+};
+
+} // namespace headless
+
+#endif // HEADLESS_PUBLIC_UTIL_HTTP_URL_FETCHER_H_

Powered by Google App Engine
This is Rietveld 408576698