Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Side by Side Diff: content/common/net/url_fetcher.cc

Issue 2405483002: Make the request initiator Optional (Closed)
Patch Set: Addressed comments + rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | content/common/resource_request.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/public/common/url_fetcher.h" 5 #include "content/public/common/url_fetcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "content/common/net/url_request_user_data.h" 8 #include "content/common/net/url_request_user_data.h"
9 #include "net/url_request/url_fetcher.h" 9 #include "net/url_request/url_fetcher.h"
10 10
11 namespace content { 11 namespace content {
12 12
13 namespace { 13 namespace {
14 14
15 base::SupportsUserData::Data* CreateURLRequestUserData(int render_process_id, 15 base::SupportsUserData::Data* CreateURLRequestUserData(int render_process_id,
16 int render_frame_id) { 16 int render_frame_id) {
17 return new URLRequestUserData(render_process_id, render_frame_id); 17 return new URLRequestUserData(render_process_id, render_frame_id);
18 } 18 }
19 19
20 } // namespace 20 } // namespace
21 21
22 void AssociateURLFetcherWithRenderFrame(net::URLFetcher* url_fetcher, 22 void AssociateURLFetcherWithRenderFrame(
23 const GURL& initiator, 23 net::URLFetcher* url_fetcher,
24 int render_process_id, 24 const base::Optional<url::Origin>& initiator,
25 int render_frame_id) { 25 int render_process_id,
26 url_fetcher->SetInitiatorURL(initiator); 26 int render_frame_id) {
27 url_fetcher->SetInitiator(initiator);
27 url_fetcher->SetURLRequestUserData( 28 url_fetcher->SetURLRequestUserData(
28 URLRequestUserData::kUserDataKey, 29 URLRequestUserData::kUserDataKey,
29 base::Bind(&CreateURLRequestUserData, 30 base::Bind(&CreateURLRequestUserData, render_process_id,
30 render_process_id, render_frame_id)); 31 render_frame_id));
31 } 32 }
32 33
33 } // namespace content 34 } // namespace content
OLDNEW
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | content/common/resource_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698