| 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 <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 std::vector<std::pair<int, std::string>> GetErrors() { | 88 std::vector<std::pair<int, std::string>> GetErrors() { |
| 89 return errors_; | 89 return errors_; |
| 90 } | 90 } |
| 91 | 91 |
| 92 void RunOnError(const base::Closure& callback) { | 92 void RunOnError(const base::Closure& callback) { |
| 93 error_callback_ = callback; | 93 error_callback_ = callback; |
| 94 waiter_.WaitForEvent(EVENT_ERROR); | 94 waiter_.WaitForEvent(EVENT_ERROR); |
| 95 } | 95 } |
| 96 | 96 |
| 97 std::unique_ptr<ProxyResolverV8Tracing::Bindings> CreateBindings() { | 97 std::unique_ptr<ProxyResolverV8Tracing::Bindings> CreateBindings() { |
| 98 return base::WrapUnique(new ForwardingBindings(this)); | 98 return base::MakeUnique<ForwardingBindings>(this); |
| 99 } | 99 } |
| 100 | 100 |
| 101 private: | 101 private: |
| 102 class ForwardingBindings : public ProxyResolverV8Tracing::Bindings { | 102 class ForwardingBindings : public ProxyResolverV8Tracing::Bindings { |
| 103 public: | 103 public: |
| 104 explicit ForwardingBindings(MockBindings* bindings) : bindings_(bindings) {} | 104 explicit ForwardingBindings(MockBindings* bindings) : bindings_(bindings) {} |
| 105 | 105 |
| 106 // ProxyResolverV8Tracing::Bindings overrides. | 106 // ProxyResolverV8Tracing::Bindings overrides. |
| 107 void Alert(const base::string16& message) override { | 107 void Alert(const base::string16& message) override { |
| 108 DCHECK(thread_checker_.CalledOnValidThread()); | 108 DCHECK(thread_checker_.CalledOnValidThread()); |
| (...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 proxy_uri.substr(0, proxy_uri.find(':') + 1)); | 1035 proxy_uri.substr(0, proxy_uri.find(':') + 1)); |
| 1036 } else { | 1036 } else { |
| 1037 NOTREACHED(); | 1037 NOTREACHED(); |
| 1038 } | 1038 } |
| 1039 } | 1039 } |
| 1040 } | 1040 } |
| 1041 | 1041 |
| 1042 } // namespace | 1042 } // namespace |
| 1043 | 1043 |
| 1044 } // namespace net | 1044 } // namespace net |
| OLD | NEW |