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

Side by Side Diff: net/proxy/proxy_resolver_v8_tracing.cc

Issue 1149763005: Change NetLog::ParametersCallback to return a scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments on ownership removed Created 5 years, 7 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
« no previous file with comments | « net/proxy/proxy_config.cc ('k') | net/proxy/proxy_script_decider.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "net/proxy/proxy_resolver_v8_tracing.h" 5 #include "net/proxy/proxy_resolver_v8_tracing.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // under the tracing optimization. It is not expected to hit this normally. 52 // under the tracing optimization. It is not expected to hit this normally.
53 const size_t kMaxUniqueResolveDnsPerExec = 20; 53 const size_t kMaxUniqueResolveDnsPerExec = 20;
54 54
55 // Approximate number of bytes to use for buffering alerts() and errors. 55 // Approximate number of bytes to use for buffering alerts() and errors.
56 // This is a failsafe in case repeated executions of the script causes 56 // This is a failsafe in case repeated executions of the script causes
57 // too much memory bloat. It is not expected for well behaved scripts to 57 // too much memory bloat. It is not expected for well behaved scripts to
58 // hit this. (In fact normal scripts should not even have alerts() or errors). 58 // hit this. (In fact normal scripts should not even have alerts() or errors).
59 const size_t kMaxAlertsAndErrorsBytes = 2048; 59 const size_t kMaxAlertsAndErrorsBytes = 2048;
60 60
61 // Returns event parameters for a PAC error message (line number + message). 61 // Returns event parameters for a PAC error message (line number + message).
62 base::Value* NetLogErrorCallback(int line_number, 62 scoped_ptr<base::Value> NetLogErrorCallback(
63 const base::string16* message, 63 int line_number,
64 NetLogCaptureMode /* capture_mode */) { 64 const base::string16* message,
65 base::DictionaryValue* dict = new base::DictionaryValue(); 65 NetLogCaptureMode /* capture_mode */) {
66 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
66 dict->SetInteger("line_number", line_number); 67 dict->SetInteger("line_number", line_number);
67 dict->SetString("message", *message); 68 dict->SetString("message", *message);
68 return dict; 69 return dict.Pass();
69 } 70 }
70 71
71 // The Job class is responsible for executing GetProxyForURL() and 72 // The Job class is responsible for executing GetProxyForURL() and
72 // creating ProxyResolverV8 instances, since both of these operations share 73 // creating ProxyResolverV8 instances, since both of these operations share
73 // similar code. 74 // similar code.
74 // 75 //
75 // The DNS for these operations can operate in either blocking or 76 // The DNS for these operations can operate in either blocking or
76 // non-blocking mode. Blocking mode is used as a fallback when the PAC script 77 // non-blocking mode. Blocking mode is used as a fallback when the PAC script
77 // seems to be misbehaving under the tracing optimization. 78 // seems to be misbehaving under the tracing optimization.
78 // 79 //
(...skipping 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 return ERR_IO_PENDING; 1192 return ERR_IO_PENDING;
1192 } 1193 }
1193 1194
1194 void ProxyResolverFactoryV8Tracing::RemoveJob( 1195 void ProxyResolverFactoryV8Tracing::RemoveJob(
1195 ProxyResolverFactoryV8Tracing::CreateJob* job) { 1196 ProxyResolverFactoryV8Tracing::CreateJob* job) {
1196 size_t erased = jobs_.erase(job); 1197 size_t erased = jobs_.erase(job);
1197 DCHECK_EQ(1u, erased); 1198 DCHECK_EQ(1u, erased);
1198 } 1199 }
1199 1200
1200 } // namespace net 1201 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_config.cc ('k') | net/proxy/proxy_script_decider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698