OLD | NEW |
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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
9 #include "base/profiler/scoped_tracker.h" | 9 #include "base/profiler/scoped_tracker.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 // Approximate number of bytes to use for buffering alerts() and errors. | 51 // Approximate number of bytes to use for buffering alerts() and errors. |
52 // This is a failsafe in case repeated executions of the script causes | 52 // This is a failsafe in case repeated executions of the script causes |
53 // too much memory bloat. It is not expected for well behaved scripts to | 53 // too much memory bloat. It is not expected for well behaved scripts to |
54 // hit this. (In fact normal scripts should not even have alerts() or errors). | 54 // hit this. (In fact normal scripts should not even have alerts() or errors). |
55 const size_t kMaxAlertsAndErrorsBytes = 2048; | 55 const size_t kMaxAlertsAndErrorsBytes = 2048; |
56 | 56 |
57 // Returns event parameters for a PAC error message (line number + message). | 57 // Returns event parameters for a PAC error message (line number + message). |
58 base::Value* NetLogErrorCallback(int line_number, | 58 base::Value* NetLogErrorCallback(int line_number, |
59 const base::string16* message, | 59 const base::string16* message, |
60 NetLog::LogLevel /* log_level */) { | 60 NetLogCaptureMode /* capture_mode */) { |
61 base::DictionaryValue* dict = new base::DictionaryValue(); | 61 base::DictionaryValue* dict = new base::DictionaryValue(); |
62 dict->SetInteger("line_number", line_number); | 62 dict->SetInteger("line_number", line_number); |
63 dict->SetString("message", *message); | 63 dict->SetString("message", *message); |
64 return dict; | 64 return dict; |
65 } | 65 } |
66 | 66 |
67 } // namespace | 67 } // namespace |
68 | 68 |
69 // The Job class is responsible for executing GetProxyForURL() and | 69 // The Job class is responsible for executing GetProxyForURL() and |
70 // SetPacScript(), since both of these operations share similar code. | 70 // SetPacScript(), since both of these operations share similar code. |
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 DCHECK(!set_pac_script_job_.get()); | 1029 DCHECK(!set_pac_script_job_.get()); |
1030 CHECK_EQ(0, num_outstanding_callbacks_); | 1030 CHECK_EQ(0, num_outstanding_callbacks_); |
1031 | 1031 |
1032 set_pac_script_job_ = new Job(this); | 1032 set_pac_script_job_ = new Job(this); |
1033 set_pac_script_job_->StartSetPacScript(script_data, callback); | 1033 set_pac_script_job_->StartSetPacScript(script_data, callback); |
1034 | 1034 |
1035 return ERR_IO_PENDING; | 1035 return ERR_IO_PENDING; |
1036 } | 1036 } |
1037 | 1037 |
1038 } // namespace net | 1038 } // namespace net |
OLD | NEW |