OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | |
boliu
2016/12/08 05:48:38
no (c)
sgurun-gerrit only
2016/12/08 21:56:46
Done.
| |
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 "android_webview/browser/net/aw_web_resource_request.h" | |
6 | |
7 #include "content/public/browser/resource_request_info.h" | |
8 #include "net/http/http_request_headers.h" | |
9 #include "net/http/http_response_headers.h" | |
10 #include "net/url_request/url_request.h" | |
11 | |
12 using std::string; | |
boliu
2016/12/08 05:48:38
these are never used
sgurun-gerrit only
2016/12/08 21:56:46
Done.
| |
13 using std::vector; | |
14 | |
15 namespace android_webview { | |
16 | |
17 AwWebResourceRequest::AwWebResourceRequest(const net::URLRequest* request) | |
18 : url(request->url().spec()), method(request->method()) { | |
19 const content::ResourceRequestInfo* info = | |
20 content::ResourceRequestInfo::ForRequest(request); | |
21 is_main_frame = | |
22 info && info->GetResourceType() == content::RESOURCE_TYPE_MAIN_FRAME; | |
23 has_user_gesture = info && info->HasUserGesture(); | |
24 | |
25 net::HttpRequestHeaders headers; | |
26 if (!request->GetFullRequestHeaders(&headers)) | |
27 headers = request->extra_request_headers(); | |
28 net::HttpRequestHeaders::Iterator headers_iterator(headers); | |
29 while (headers_iterator.GetNext()) { | |
30 header_names.push_back(headers_iterator.name()); | |
31 header_values.push_back(headers_iterator.value()); | |
32 } | |
33 } | |
34 | |
35 } // namespace android_webview | |
OLD | NEW |