blob: 1464634c36c1db0df1516af4b6c6645cd2e830f0 [file] [log] [blame]
kenod930e48032023-05-18 11:38:401// Copyright 2023 The Chromium Authors
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 CONTENT_BROWSER_PRELOADING_PRERENDER_DEVTOOLS_PRERENDER_ATTEMPT_H_
6#define CONTENT_BROWSER_PRELOADING_PRERENDER_DEVTOOLS_PRERENDER_ATTEMPT_H_
7
8#include "content/browser/preloading/prerender/prerender_attributes.h"
9#include "content/browser/preloading/prerender/prerender_final_status.h"
kenoe16970c2023-06-26 10:59:2910#include "content/browser/preloading/prerender/prerender_metrics.h"
kenod930e48032023-05-18 11:38:4011#include "content/common/content_export.h"
12
13namespace content {
14
15// Represents information shared to DevTools clients by CDP event
16// Preload.prerenderStatusUpdated. Counterpart of the frontend is
17// SDK.PreloadingModel.PrerenderAttemptInternal.
18//
19// All status updates will be shared as soon as they are made.
20class CONTENT_EXPORT DevToolsPrerenderAttempt {
21 public:
22 DevToolsPrerenderAttempt() = default;
23 ~DevToolsPrerenderAttempt() = default;
24
25 DevToolsPrerenderAttempt(const DevToolsPrerenderAttempt&) = delete;
26 DevToolsPrerenderAttempt& operator=(const DevToolsPrerenderAttempt&) = delete;
27 DevToolsPrerenderAttempt(DevToolsPrerenderAttempt&&) = delete;
28 DevToolsPrerenderAttempt& operator=(DevToolsPrerenderAttempt&&) = delete;
29
30 void SetTriggeringOutcome(const PrerenderAttributes& attributes,
31 PreloadingTriggeringOutcome outcome);
32 void SetFailureReason(const PrerenderAttributes& attributes,
kenoe16970c2023-06-26 10:59:2933 PrerenderFinalStatus prerender_status);
34 void SetFailureReason(const PrerenderAttributes& attributes,
35 const PrerenderCancellationReason& reasons);
kenod930e48032023-05-18 11:38:4036};
37
38} // namespace content
39
40#endif // CONTENT_BROWSER_PRELOADING_PRERENDER_DEVTOOLS_PRERENDER_ATTEMPT_H_