OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef HEADLESS_PUBLIC_UTIL_HTTP_URL_FETCHER_H_ |
| 6 #define HEADLESS_PUBLIC_UTIL_HTTP_URL_FETCHER_H_ |
| 7 |
| 8 #include "base/callback.h" |
| 9 #include "base/macros.h" |
| 10 #include "base/memory/weak_ptr.h" |
| 11 #include "headless/public/devtools/domains/page.h" |
| 12 #include "headless/public/util/navigation_request.h" |
| 13 |
| 14 namespace headless { |
| 15 class HeadlessShell; |
| 16 |
| 17 // Used in deterministic mode to make sure navigations and resource requests |
| 18 // complete in the order requested. |
| 19 class ShellNavigationRequest : public NavigationRequest { |
| 20 public: |
| 21 ShellNavigationRequest(base::WeakPtr<HeadlessShell> headless_shell, |
| 22 const page::NavigationRequestedParams& params); |
| 23 |
| 24 ~ShellNavigationRequest() override; |
| 25 |
| 26 void StartProcessing(base::Closure done_callback) override; |
| 27 |
| 28 private: |
| 29 // Note the navigation likely isn't done when this is called, however we |
| 30 // expect it will have been committed and the initial resource load requested. |
| 31 static void ProcessNavigationResult( |
| 32 base::Closure done_callback, |
| 33 std::unique_ptr<page::ProcessNavigationResult>); |
| 34 |
| 35 base::WeakPtr<HeadlessShell> headless_shell_; |
| 36 int navigation_id_; |
| 37 }; |
| 38 |
| 39 } // namespace headless |
| 40 |
| 41 #endif // HEADLESS_PUBLIC_UTIL_HTTP_URL_FETCHER_H_ |
OLD | NEW |