| 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
| 16 #include "base/format_macros.h" | 16 #include "base/format_macros.h" |
| 17 #include "base/guid.h" | 17 #include "base/guid.h" |
| 18 #include "base/json/json_reader.h" | 18 #include "base/json/json_reader.h" |
| 19 #include "base/json/json_writer.h" | 19 #include "base/json/json_writer.h" |
| 20 #include "base/rand_util.h" | 20 #include "base/rand_util.h" |
| 21 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
| 22 #include "base/strings/string_util.h" | 22 #include "base/strings/string_util.h" |
| 23 #include "base/strings/stringprintf.h" | 23 #include "base/strings/stringprintf.h" |
| 24 #include "cloud_print/gcp20/prototype/command_line_reader.h" | 24 #include "cloud_print/gcp20/prototype/command_line_reader.h" |
| 25 #include "cloud_print/gcp20/prototype/gcp20_switches.h" | 25 #include "cloud_print/gcp20/prototype/gcp20_switches.h" |
| 26 #include "cloud_print/gcp20/prototype/local_settings.h" | 26 #include "cloud_print/gcp20/prototype/local_settings.h" |
| 27 #include "cloud_print/gcp20/prototype/service_parameters.h" | 27 #include "cloud_print/gcp20/prototype/service_parameters.h" |
| 28 #include "cloud_print/gcp20/prototype/special_io.h" | 28 #include "cloud_print/gcp20/prototype/special_io.h" |
| 29 #include "cloud_print/version.h" | 29 #include "cloud_print/version.h" |
| 30 #include "net/base/net_util.h" | 30 #include "net/base/network_interfaces.h" |
| 31 #include "net/base/url_util.h" | 31 #include "net/base/url_util.h" |
| 32 | 32 |
| 33 const char kPrinterStatePathDefault[] = "printer_state.json"; | 33 const char kPrinterStatePathDefault[] = "printer_state.json"; |
| 34 | 34 |
| 35 namespace { | 35 namespace { |
| 36 | 36 |
| 37 const uint16 kHttpPortDefault = 10101; | 37 const uint16 kHttpPortDefault = 10101; |
| 38 const uint32 kTtlDefault = 60*60; // in seconds | 38 const uint32 kTtlDefault = 60*60; // in seconds |
| 39 | 39 |
| 40 const char kServiceType[] = "_privet._tcp.local"; | 40 const char kServiceType[] = "_privet._tcp.local"; |
| (...skipping 915 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 |