blob: 6ac2bf75d8b47b218c69edb2df06c26f0204fb1e (
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
37
|
// Copyright (c) 2012 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 "content/public/common/url_fetcher.h"
#include "base/bind.h"
#include "base/memory/ptr_util.h"
#include "content/common/net/url_request_user_data.h"
#include "net/url_request/url_fetcher.h"
namespace content {
namespace {
std::unique_ptr<base::SupportsUserData::Data> CreateURLRequestUserData(
int render_process_id,
int render_frame_id) {
return base::MakeUnique<URLRequestUserData>(render_process_id,
render_frame_id);
}
} // namespace
void AssociateURLFetcherWithRenderFrame(
net::URLFetcher* url_fetcher,
const base::Optional<url::Origin>& initiator,
int render_process_id,
int render_frame_id) {
url_fetcher->SetInitiator(initiator);
url_fetcher->SetURLRequestUserData(
URLRequestUserData::kUserDataKey,
base::Bind(&CreateURLRequestUserData, render_process_id,
render_frame_id));
}
} // namespace content
|