summaryrefslogtreecommitdiffstats
path: root/chrome/browser/privacy_blacklist/blacklist_request_info.cc
blob: ff605130112d50406811e15a67aa0f1e0ba78abf (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
// Copyright (c) 2009 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.

#include "chrome/browser/privacy_blacklist/blacklist_request_info.h"

// static
const void* const BlacklistRequestInfo::kURLRequestDataKey = 0;

BlacklistRequestInfo::BlacklistRequestInfo(const GURL& url,
                                           ResourceType::Type resource_type,
                                           const Blacklist* blacklist)
    : url_(url),
      resource_type_(resource_type),
      blacklist_(blacklist) {
}

BlacklistRequestInfo::~BlacklistRequestInfo() {
}

// static
BlacklistRequestInfo* BlacklistRequestInfo::FromURLRequest(
    const URLRequest* request) {
  URLRequest::UserData* user_data =
      request->GetUserData(&kURLRequestDataKey);
  return (user_data ? static_cast<BlacklistRequestInfo*>(user_data) : NULL);
}