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

Side by Side Diff: extensions/browser/api/web_request/web_request_api_helpers.cc

Issue 2333923004: Extracting NetLog inner classes into their own classes. (Closed)
Patch Set: Some nit fixes and better, impl-agnostic naming of net_log_parameters_callback_typedef.h -> net/log… Created 4 years, 2 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
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 "extensions/browser/api/web_request/web_request_api_helpers.h" 5 #include "extensions/browser/api/web_request/web_request_api_helpers.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 14 matching lines...) Expand all
25 #include "extensions/browser/extension_registry.h" 25 #include "extensions/browser/extension_registry.h"
26 #include "extensions/browser/extension_system.h" 26 #include "extensions/browser/extension_system.h"
27 #include "extensions/browser/extensions_browser_client.h" 27 #include "extensions/browser/extensions_browser_client.h"
28 #include "extensions/browser/runtime_data.h" 28 #include "extensions/browser/runtime_data.h"
29 #include "extensions/browser/warning_set.h" 29 #include "extensions/browser/warning_set.h"
30 #include "extensions/common/extension_messages.h" 30 #include "extensions/common/extension_messages.h"
31 #include "net/cookies/cookie_util.h" 31 #include "net/cookies/cookie_util.h"
32 #include "net/cookies/parsed_cookie.h" 32 #include "net/cookies/parsed_cookie.h"
33 #include "net/http/http_util.h" 33 #include "net/http/http_util.h"
34 #include "net/log/net_log.h" 34 #include "net/log/net_log.h"
35 #include "net/log/net_log_capture_mode.h"
35 #include "net/log/net_log_event_type.h" 36 #include "net/log/net_log_event_type.h"
37 #include "net/log/net_log_parameters_callback.h"
38 #include "net/log/net_log_with_source.h"
36 #include "net/url_request/url_request.h" 39 #include "net/url_request/url_request.h"
37 #include "url/url_constants.h" 40 #include "url/url_constants.h"
38 41
39 // TODO(battre): move all static functions into an anonymous namespace at the 42 // TODO(battre): move all static functions into an anonymous namespace at the
40 // top of this file. 43 // top of this file.
41 44
42 using base::Time; 45 using base::Time;
43 using content::ResourceType; 46 using content::ResourceType;
44 using net::cookie_util::ParsedRequestCookie; 47 using net::cookie_util::ParsedRequestCookie;
45 using net::cookie_util::ParsedRequestCookies; 48 using net::cookie_util::ParsedRequestCookies;
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 cancel(false) { 251 cancel(false) {
249 } 252 }
250 253
251 EventResponseDelta::~EventResponseDelta() { 254 EventResponseDelta::~EventResponseDelta() {
252 } 255 }
253 256
254 257
255 // Creates a NetLog callback the returns a Value with the ID of the extension 258 // Creates a NetLog callback the returns a Value with the ID of the extension
256 // that caused an event. |delta| must remain valid for the lifetime of the 259 // that caused an event. |delta| must remain valid for the lifetime of the
257 // callback. 260 // callback.
258 net::NetLog::ParametersCallback CreateNetLogExtensionIdCallback( 261 net::NetLogParametersCallback CreateNetLogExtensionIdCallback(
259 const EventResponseDelta* delta) { 262 const EventResponseDelta* delta) {
260 return net::NetLog::StringCallback("extension_id", &delta->extension_id); 263 return net::NetLog::StringCallback("extension_id", &delta->extension_id);
261 } 264 }
262 265
263 // Creates NetLog parameters to indicate that an extension modified a request. 266 // Creates NetLog parameters to indicate that an extension modified a request.
264 std::unique_ptr<base::Value> NetLogModificationCallback( 267 std::unique_ptr<base::Value> NetLogModificationCallback(
265 const EventResponseDelta* delta, 268 const EventResponseDelta* delta,
266 net::NetLogCaptureMode capture_mode) { 269 net::NetLogCaptureMode capture_mode) {
267 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); 270 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
268 dict->SetString("extension_id", delta->extension_id); 271 dict->SetString("extension_id", delta->extension_id);
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 for (size_t i = 0; i < kResourceTypeStringsLength; ++i) { 1315 for (size_t i = 0; i < kResourceTypeStringsLength; ++i) {
1313 if (type_str == kResourceTypeStrings[i]) { 1316 if (type_str == kResourceTypeStrings[i]) {
1314 found = true; 1317 found = true;
1315 types->push_back(kResourceTypeValues[i]); 1318 types->push_back(kResourceTypeValues[i]);
1316 } 1319 }
1317 } 1320 }
1318 return found; 1321 return found;
1319 } 1322 }
1320 1323
1321 } // namespace extension_web_request_api_helpers 1324 } // namespace extension_web_request_api_helpers
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698