| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cloud_print/gcp20/prototype/printer.h" | 5 #include "cloud_print/gcp20/prototype/printer.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 #include <stdio.h> | 8 #include <stdio.h> |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 133 |
| 134 std::string GetDescription() { | 134 std::string GetDescription() { |
| 135 std::string result = kPrinterDescription; | 135 std::string result = kPrinterDescription; |
| 136 net::IPAddressNumber ip = GetLocalIp("", false); | 136 net::IPAddressNumber ip = GetLocalIp("", false); |
| 137 if (!ip.empty()) | 137 if (!ip.empty()) |
| 138 result += " at " + net::IPAddressToString(ip); | 138 result += " at " + net::IPAddressToString(ip); |
| 139 return result; | 139 return result; |
| 140 } | 140 } |
| 141 | 141 |
| 142 scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() { | 142 scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() { |
| 143 return base::MessageLoop::current()->message_loop_proxy(); | 143 return base::MessageLoop::current()->task_runner(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 } // namespace | 146 } // namespace |
| 147 | 147 |
| 148 using cloud_print_response_parser::Job; | 148 using cloud_print_response_parser::Job; |
| 149 | 149 |
| 150 Printer::Printer() | 150 Printer::Printer() |
| 151 : connection_state_(OFFLINE), | 151 : connection_state_(OFFLINE), |
| 152 http_server_(this), | 152 http_server_(this), |
| 153 on_idle_posted_(false), | 153 on_idle_posted_(false), |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 | 956 |
| 957 dns_server_.UpdateMetadata(CreateTxt()); | 957 dns_server_.UpdateMetadata(CreateTxt()); |
| 958 | 958 |
| 959 if (connection_state_ == OFFLINE) { | 959 if (connection_state_ == OFFLINE) { |
| 960 requester_.reset(); | 960 requester_.reset(); |
| 961 xmpp_listener_.reset(); | 961 xmpp_listener_.reset(); |
| 962 } | 962 } |
| 963 | 963 |
| 964 return true; | 964 return true; |
| 965 } | 965 } |
| OLD | NEW |