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

Side by Side Diff: components/data_use_measurement/content/data_use_measurement_delegate_imp.cc

Issue 1355893004: Complete the layered architecture of data_use_measurement component. Base URL: https://chromium.googlesource.com/chromium/src.git@NewArchServices
Patch Set: Created 5 years, 3 months 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
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/data_use_measurement/content/data_use_measurement_delegate_ imp.h"
6
7 #include "content/public/browser/resource_request_info.h"
8
9 namespace data_use_measurement {
10
11 bool DataUseMeasurementDelegateImp::RequestIsFromUser(
12 const net::URLRequest* request) {
13 const content::ResourceRequestInfo* info =
14 content::ResourceRequestInfo::ForRequest(request);
15 // Having |info| is the sign of a request for a web content from user. For now
16 // we could add a condition to check ProcessType in info is
17 // content::PROCESS_TYPE_RENDERER, but it won't be compatible with upcoming
18 // PlzNavigate architecture. So just existence of |info| is verified, and the
19 // current check should be compatible with upcoming changes in PlzNavigate.
20 return info != nullptr;
21 }
22
23 } // namespace data_use_measurement
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698