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