summaryrefslogtreecommitdiff
path: root/chromium/services/network/crash_keys.h
blob: cab44590e6ef56e4241fd8242881e7851bfdb8bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2019 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 SERVICES_NETWORK_CRASH_KEYS_H_
#define SERVICES_NETWORK_CRASH_KEYS_H_

#include "base/debug/crash_logging.h"
#include "base/optional.h"
#include "url/origin.h"

namespace network {

struct ResourceRequest;

namespace debug {

base::debug::CrashKeyString* GetRequestInitiatorSiteLockCrashKey();

class ScopedRequestCrashKeys {
 public:
  ScopedRequestCrashKeys(const network::ResourceRequest& request);
  ~ScopedRequestCrashKeys();

  ScopedRequestCrashKeys(const ScopedRequestCrashKeys&) = delete;
  ScopedRequestCrashKeys& operator=(const ScopedRequestCrashKeys&) = delete;

 private:
  base::debug::ScopedCrashKeyString url_;
  url::debug::ScopedOriginCrashKey request_initiator_;
};

}  // namespace debug
}  // namespace network

#endif  // SERVICES_NETWORK_CRASH_KEYS_H_