diff options
44 files changed, 162 insertions, 93 deletions
diff --git a/cloud_print/gcp20/prototype/cloud_print_request.cc b/cloud_print/gcp20/prototype/cloud_print_request.cc index 6eebcb5..455dbaf 100644 --- a/cloud_print/gcp20/prototype/cloud_print_request.cc +++ b/cloud_print/gcp20/prototype/cloud_print_request.cc @@ -4,6 +4,8 @@ #include "cloud_print/gcp20/prototype/cloud_print_request.h" +#include <stdint.h> + #include "base/bind.h" #include "base/command_line.h" #include "base/message_loop/message_loop.h" @@ -19,7 +21,7 @@ using base::MessageLoop; namespace { -const uint32 kDefaultTimeout = 20; // in seconds +const uint32_t kDefaultTimeout = 20; // in seconds } // namespace diff --git a/cloud_print/gcp20/prototype/cloud_print_request.h b/cloud_print/gcp20/prototype/cloud_print_request.h index 5cd8357..749f5ae 100644 --- a/cloud_print/gcp20/prototype/cloud_print_request.h +++ b/cloud_print/gcp20/prototype/cloud_print_request.h @@ -7,8 +7,8 @@ #include <string> -#include "base/basictypes.h" #include "base/callback.h" +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "net/url_request/url_fetcher.h" #include "net/url_request/url_fetcher_delegate.h" diff --git a/cloud_print/gcp20/prototype/cloud_print_requester.h b/cloud_print/gcp20/prototype/cloud_print_requester.h index ea7e8af..6c543cc 100644 --- a/cloud_print/gcp20/prototype/cloud_print_requester.h +++ b/cloud_print/gcp20/prototype/cloud_print_requester.h @@ -8,8 +8,8 @@ #include <string> #include <vector> -#include "base/basictypes.h" #include "base/callback.h" +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/values.h" #include "cloud_print/gcp20/prototype/cloud_print_request.h" diff --git a/cloud_print/gcp20/prototype/cloud_print_response_parser.cc b/cloud_print/gcp20/prototype/cloud_print_response_parser.cc index c43ed39..acd8599 100644 --- a/cloud_print/gcp20/prototype/cloud_print_response_parser.cc +++ b/cloud_print/gcp20/prototype/cloud_print_response_parser.cc @@ -4,6 +4,9 @@ #include "cloud_print/gcp20/prototype/cloud_print_response_parser.h" +#include <stddef.h> +#include <stdint.h> + #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/logging.h" @@ -196,7 +199,7 @@ bool ParseFetchResponse(const std::string& response, *error_description = "Cannot parse job info."; return false; } - int64 create_time_ms = 0; + int64_t create_time_ms = 0; if (!base::StringToInt64(create_time_str, &create_time_ms)) { *error_description = "Cannot convert time."; return false; diff --git a/cloud_print/gcp20/prototype/cloud_print_url_request_context_getter.h b/cloud_print/gcp20/prototype/cloud_print_url_request_context_getter.h index 3be2499..44de4e7 100644 --- a/cloud_print/gcp20/prototype/cloud_print_url_request_context_getter.h +++ b/cloud_print/gcp20/prototype/cloud_print_url_request_context_getter.h @@ -5,7 +5,7 @@ #ifndef CLOUD_PRINT_GCP20_PROTOTYPE_CLOUD_PRINT_URL_REQUEST_CONTEXT_GETTER_H_ #define CLOUD_PRINT_GCP20_PROTOTYPE_CLOUD_PRINT_URL_REQUEST_CONTEXT_GETTER_H_ -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "net/url_request/url_request_context_getter.h" diff --git a/cloud_print/gcp20/prototype/cloud_print_xmpp_listener.cc b/cloud_print/gcp20/prototype/cloud_print_xmpp_listener.cc index 6c7c235..4a02cae 100644 --- a/cloud_print/gcp20/prototype/cloud_print_xmpp_listener.cc +++ b/cloud_print/gcp20/prototype/cloud_print_xmpp_listener.cc @@ -4,6 +4,8 @@ #include "cloud_print/gcp20/prototype/cloud_print_xmpp_listener.h" +#include <stddef.h> + #include "base/bind.h" #include "base/logging.h" #include "base/message_loop/message_loop.h" diff --git a/cloud_print/gcp20/prototype/cloud_print_xmpp_listener.h b/cloud_print/gcp20/prototype/cloud_print_xmpp_listener.h index 8c8ed9d..ff5e9c7 100644 --- a/cloud_print/gcp20/prototype/cloud_print_xmpp_listener.h +++ b/cloud_print/gcp20/prototype/cloud_print_xmpp_listener.h @@ -7,8 +7,8 @@ #include <string> -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" diff --git a/cloud_print/gcp20/prototype/command_line_reader.cc b/cloud_print/gcp20/prototype/command_line_reader.cc index 10988d2..7775822 100644 --- a/cloud_print/gcp20/prototype/command_line_reader.cc +++ b/cloud_print/gcp20/prototype/command_line_reader.cc @@ -4,6 +4,8 @@ #include "cloud_print/gcp20/prototype/command_line_reader.h" +#include <stdint.h> + #include <limits> #include "base/command_line.h" diff --git a/cloud_print/gcp20/prototype/dns_packet_parser.cc b/cloud_print/gcp20/prototype/dns_packet_parser.cc index e52ba39..ef45e20 100644 --- a/cloud_print/gcp20/prototype/dns_packet_parser.cc +++ b/cloud_print/gcp20/prototype/dns_packet_parser.cc @@ -4,6 +4,8 @@ #include "cloud_print/gcp20/prototype/dns_packet_parser.h" +#include <stddef.h> + #include "base/big_endian.h" #include "base/logging.h" diff --git a/cloud_print/gcp20/prototype/dns_packet_parser.h b/cloud_print/gcp20/prototype/dns_packet_parser.h index 88c6a03..38305c2 100644 --- a/cloud_print/gcp20/prototype/dns_packet_parser.h +++ b/cloud_print/gcp20/prototype/dns_packet_parser.h @@ -5,8 +5,12 @@ #ifndef CLOUD_PRINT_GCP20_PROTOTYPE_DNS_PACKET_PARSER_H_ #define CLOUD_PRINT_GCP20_PROTOTYPE_DNS_PACKET_PARSER_H_ +#include <stddef.h> +#include <stdint.h> + #include <string> +#include "base/macros.h" #include "net/dns/dns_protocol.h" #include "net/dns/dns_response.h" @@ -16,8 +20,8 @@ struct DnsQueryRecord { ~DnsQueryRecord() {} std::string qname; // in dotted form - uint16 qtype; - uint16 qclass; + uint16_t qtype; + uint16_t qclass; }; // Iterator to walk over records of the DNS response packet. Encapsulates diff --git a/cloud_print/gcp20/prototype/dns_response_builder.cc b/cloud_print/gcp20/prototype/dns_response_builder.cc index c73689c..5fe77c6 100644 --- a/cloud_print/gcp20/prototype/dns_response_builder.cc +++ b/cloud_print/gcp20/prototype/dns_response_builder.cc @@ -4,6 +4,9 @@ #include "cloud_print/gcp20/prototype/dns_response_builder.h" +#include <stddef.h> +#include <stdint.h> + #include "base/big_endian.h" #include "base/logging.h" #include "net/base/io_buffer.h" @@ -13,7 +16,7 @@ namespace { -uint16 klass = net::dns_protocol::kClassIN; +uint16_t klass = net::dns_protocol::kClassIN; } // namespace @@ -23,7 +26,7 @@ DnsResponseRecord::DnsResponseRecord() : type(0), klass(0), ttl(0) { DnsResponseRecord::~DnsResponseRecord() { } -DnsResponseBuilder::DnsResponseBuilder(uint16 id) { +DnsResponseBuilder::DnsResponseBuilder(uint16_t id) { header_.id = id; // TODO(maksymb): Check do we need AA flag enabled. header_.flags = net::dns_protocol::kFlagResponse | @@ -38,7 +41,7 @@ DnsResponseBuilder::~DnsResponseBuilder() { } void DnsResponseBuilder::AppendPtr(const std::string& service_type, - uint32 ttl, + uint32_t ttl, const std::string& service_name, bool answer) { std::string rdata; @@ -49,17 +52,17 @@ void DnsResponseBuilder::AppendPtr(const std::string& service_type, } void DnsResponseBuilder::AppendSrv(const std::string& service_name, - uint32 ttl, - uint16 priority, - uint16 weight, - uint16 http_port, + uint32_t ttl, + uint16_t priority, + uint16_t weight, + uint16_t http_port, const std::string& service_domain_name, bool answer) { std::string domain_name; bool success = net::DNSDomainFromDot(service_domain_name, &domain_name); DCHECK(success); - std::vector<uint8> rdata(2 + 2 + 2 + domain_name.size()); + std::vector<uint8_t> rdata(2 + 2 + 2 + domain_name.size()); base::BigEndianWriter writer(reinterpret_cast<char*>(rdata.data()), rdata.size()); @@ -75,7 +78,7 @@ void DnsResponseBuilder::AppendSrv(const std::string& service_name, } void DnsResponseBuilder::AppendA(const std::string& service_domain_name, - uint32 ttl, + uint32_t ttl, net::IPAddressNumber http_ipv4, bool answer) { // TODO(maksymb): IP to send must depends on interface from where query was @@ -89,7 +92,7 @@ void DnsResponseBuilder::AppendA(const std::string& service_domain_name, } void DnsResponseBuilder::AppendAAAA(const std::string& service_domain_name, - uint32 ttl, + uint32_t ttl, net::IPAddressNumber http_ipv6, bool answer) { // TODO(maksymb): IP to send must depends on interface from where query was @@ -103,7 +106,7 @@ void DnsResponseBuilder::AppendAAAA(const std::string& service_domain_name, } void DnsResponseBuilder::AppendTxt(const std::string& service_name, - uint32 ttl, + uint32_t ttl, const std::vector<std::string>& metadata, bool answer) { std::string rdata; @@ -153,10 +156,9 @@ scoped_refptr<net::IOBufferWithSize> DnsResponseBuilder::Build() { success = writer.WriteBytes(name_in_dns_format.data(), name_in_dns_format.size()) && - writer.WriteU16(iter->type) && - writer.WriteU16(iter->klass) && + writer.WriteU16(iter->type) && writer.WriteU16(iter->klass) && writer.WriteU32(iter->ttl) && - writer.WriteU16(static_cast<uint16>(iter->rdata.size())) && + writer.WriteU16(static_cast<uint16_t>(iter->rdata.size())) && writer.WriteBytes(iter->rdata.data(), iter->rdata.size()); DCHECK(success); } @@ -167,8 +169,8 @@ scoped_refptr<net::IOBufferWithSize> DnsResponseBuilder::Build() { } void DnsResponseBuilder::AddResponse(const std::string& name, - uint16 type, - uint32 ttl, + uint16_t type, + uint32_t ttl, const std::string& rdata, bool answer) { DnsResponseRecord response; diff --git a/cloud_print/gcp20/prototype/dns_response_builder.h b/cloud_print/gcp20/prototype/dns_response_builder.h index 2421fb0..9f4bae5 100644 --- a/cloud_print/gcp20/prototype/dns_response_builder.h +++ b/cloud_print/gcp20/prototype/dns_response_builder.h @@ -5,10 +5,12 @@ #ifndef CLOUD_PRINT_GCP20_PROTOTYPE_DNS_RESPONSE_BUILDER_H_ #define CLOUD_PRINT_GCP20_PROTOTYPE_DNS_RESPONSE_BUILDER_H_ +#include <stdint.h> + #include <string> #include <vector> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "net/base/io_buffer.h" #include "net/base/ip_address_number.h" @@ -24,9 +26,9 @@ struct DnsResponseRecord { ~DnsResponseRecord(); std::string name; // in dotted form - uint16 type; - uint16 klass; - uint32 ttl; + uint16_t type; + uint16_t klass; + uint32_t ttl; std::string rdata; }; @@ -34,36 +36,37 @@ struct DnsResponseRecord { class DnsResponseBuilder { public: // Initializes builder. - explicit DnsResponseBuilder(uint16 id); + explicit DnsResponseBuilder(uint16_t id); // Destroys the object. ~DnsResponseBuilder(); // Methods for appending different types of responses to packet. void AppendPtr(const std::string& service_type, - uint32 ttl, + uint32_t ttl, const std::string& service_name, bool answer); void AppendSrv(const std::string& service_name, - uint32 ttl, - uint16 priority, - uint16 weight, uint16 http_port, + uint32_t ttl, + uint16_t priority, + uint16_t weight, + uint16_t http_port, const std::string& service_domain_name, bool answer); void AppendA(const std::string& service_domain_name, - uint32 ttl, + uint32_t ttl, net::IPAddressNumber http_ipv4, bool answer); void AppendAAAA(const std::string& service_domain_name, - uint32 ttl, + uint32_t ttl, net::IPAddressNumber http_ipv6, bool answer); void AppendTxt(const std::string& service_name, - uint32 ttl, + uint32_t ttl, const std::vector<std::string>& metadata, bool answer); @@ -73,8 +76,8 @@ class DnsResponseBuilder { private: // Appends response to packet. void AddResponse(const std::string& name, - uint16 type, - uint32 ttl, + uint16_t type, + uint32_t ttl, const std::string& rdata, bool answer); diff --git a/cloud_print/gcp20/prototype/dns_sd_server.cc b/cloud_print/gcp20/prototype/dns_sd_server.cc index a3ab0b7..1389778 100644 --- a/cloud_print/gcp20/prototype/dns_sd_server.cc +++ b/cloud_print/gcp20/prototype/dns_sd_server.cc @@ -4,9 +4,9 @@ #include "cloud_print/gcp20/prototype/dns_sd_server.h" +#include <stdint.h> #include <string.h> -#include "base/basictypes.h" #include "base/bind.h" #include "base/command_line.h" #include "base/message_loop/message_loop.h" @@ -21,13 +21,13 @@ namespace { const char kDefaultIpAddressMulticast[] = "224.0.0.251"; -const uint16 kDefaultPortMulticast = 5353; +const uint16_t kDefaultPortMulticast = 5353; const double kTimeToNextAnnouncement = 0.8; // relatively to TTL const int kDnsBufSize = 65537; -const uint16 kSrvPriority = 0; -const uint16 kSrvWeight = 0; +const uint16_t kSrvPriority = 0; +const uint16_t kSrvWeight = 0; void DoNothingAfterSendToSocket(int /*val*/) { NOTREACHED(); @@ -46,7 +46,8 @@ DnsSdServer::~DnsSdServer() { Shutdown(); } -bool DnsSdServer::Start(const ServiceParameters& serv_params, uint32 full_ttl, +bool DnsSdServer::Start(const ServiceParameters& serv_params, + uint32_t full_ttl, const std::vector<std::string>& metadata) { if (IsOnline()) return true; @@ -96,7 +97,7 @@ void DnsSdServer::UpdateMetadata(const std::vector<std::string>& metadata) { // TODO(maksymb): If less than 20% of full TTL left before next announcement // then send it now. - uint32 current_ttl = GetCurrentTLL(); + uint32_t current_ttl = GetCurrentTLL(); if (!base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kNoAnnouncement)) { DnsResponseBuilder builder(current_ttl); @@ -158,7 +159,7 @@ void DnsSdServer::ProcessMessage(int len, net::IOBufferWithSize* buf) { DnsResponseBuilder builder(parser.header().id); - uint32 current_ttl = GetCurrentTLL(); + uint32_t current_ttl = GetCurrentTLL(); DnsQueryRecord query; // TODO(maksymb): Check known answers. @@ -187,7 +188,8 @@ void DnsSdServer::ProcessMessage(int len, net::IOBufferWithSize* buf) { << (unicast_respond ? recv_address_ : multicast_address_).ToString(); } -void DnsSdServer::ProccessQuery(uint32 current_ttl, const DnsQueryRecord& query, +void DnsSdServer::ProccessQuery(uint32_t current_ttl, + const DnsQueryRecord& query, DnsResponseBuilder* builder) const { std::string log; bool responded = false; @@ -274,7 +276,7 @@ void DnsSdServer::OnDatagramReceived() { DoLoop(0); } -void DnsSdServer::SendAnnouncement(uint32 ttl) { +void DnsSdServer::SendAnnouncement(uint32_t ttl) { if (!base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kNoAnnouncement)) { DnsResponseBuilder builder(ttl); @@ -307,14 +309,13 @@ void DnsSdServer::SendAnnouncement(uint32 ttl) { // Schedule next announcement. base::MessageLoop::current()->PostDelayedTask( - FROM_HERE, - base::Bind(&DnsSdServer::Update, AsWeakPtr()), - base::TimeDelta::FromSeconds(static_cast<int64>( - kTimeToNextAnnouncement*full_ttl_))); + FROM_HERE, base::Bind(&DnsSdServer::Update, AsWeakPtr()), + base::TimeDelta::FromSeconds( + static_cast<int64_t>(kTimeToNextAnnouncement * full_ttl_))); } -uint32 DnsSdServer::GetCurrentTLL() const { - uint32 current_ttl = (time_until_live_ - base::Time::Now()).InSeconds(); +uint32_t DnsSdServer::GetCurrentTLL() const { + uint32_t current_ttl = (time_until_live_ - base::Time::Now()).InSeconds(); if (time_until_live_ < base::Time::Now() || current_ttl == 0) { // This should not be reachable. But still we don't need to fail. current_ttl = 1; // Service is still alive. diff --git a/cloud_print/gcp20/prototype/dns_sd_server.h b/cloud_print/gcp20/prototype/dns_sd_server.h index dc8683f..c154c2c 100644 --- a/cloud_print/gcp20/prototype/dns_sd_server.h +++ b/cloud_print/gcp20/prototype/dns_sd_server.h @@ -5,10 +5,12 @@ #ifndef CLOUD_PRINT_GCP20_PROTOTYPE_DNS_SD_SERVER_H_ #define CLOUD_PRINT_GCP20_PROTOTYPE_DNS_SD_SERVER_H_ +#include <stdint.h> + #include <string> #include <vector> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "cloud_print/gcp20/prototype/service_parameters.h" @@ -38,7 +40,7 @@ class DnsSdServer : public base::SupportsWeakPtr<DnsSdServer> { // Starts the server. Returns |true| if server works. Also sends // announcement. bool Start(const ServiceParameters& serv_params, - uint32 full_ttl, + uint32_t full_ttl, const std::vector<std::string>& metadata) WARN_UNUSED_RESULT; // Sends announcement if server works. @@ -58,7 +60,7 @@ class DnsSdServer : public base::SupportsWeakPtr<DnsSdServer> { bool CreateSocket(); // Processes single query. - void ProccessQuery(uint32 current_ttl, + void ProccessQuery(uint32_t current_ttl, const DnsQueryRecord& query, DnsResponseBuilder* builder) const; @@ -72,11 +74,11 @@ class DnsSdServer : public base::SupportsWeakPtr<DnsSdServer> { void OnDatagramReceived(); // Sends announcement. - void SendAnnouncement(uint32 ttl); + void SendAnnouncement(uint32_t ttl); // Calculates and returns current TTL (with accordance to last send // announcement time. - uint32 GetCurrentTLL() const; + uint32_t GetCurrentTLL() const; // Stores socket to multicast address. scoped_ptr<net::UDPServerSocket> socket_; @@ -100,7 +102,7 @@ class DnsSdServer : public base::SupportsWeakPtr<DnsSdServer> { std::vector<std::string> metadata_; // TTL for announcements - uint32 full_ttl_; + uint32_t full_ttl_; DISALLOW_COPY_AND_ASSIGN(DnsSdServer); }; diff --git a/cloud_print/gcp20/prototype/gcp20_switches.cc b/cloud_print/gcp20/prototype/gcp20_switches.cc index dfb425c..85bb8dd 100644 --- a/cloud_print/gcp20/prototype/gcp20_switches.cc +++ b/cloud_print/gcp20/prototype/gcp20_switches.cc @@ -4,6 +4,8 @@ #include "cloud_print/gcp20/prototype/gcp20_switches.h" +#include <stddef.h> + #include "base/files/file_path.h" #include "base/path_service.h" diff --git a/cloud_print/gcp20/prototype/print_job_handler.cc b/cloud_print/gcp20/prototype/print_job_handler.cc index d76114b..7a4d4cd 100644 --- a/cloud_print/gcp20/prototype/print_job_handler.cc +++ b/cloud_print/gcp20/prototype/print_job_handler.cc @@ -4,6 +4,8 @@ #include "cloud_print/gcp20/prototype/print_job_handler.h" +#include <stddef.h> + #include "base/bind.h" #include "base/command_line.h" #include "base/files/file_util.h" diff --git a/cloud_print/gcp20/prototype/print_job_handler.h b/cloud_print/gcp20/prototype/print_job_handler.h index 1156803..a0a2abfc 100644 --- a/cloud_print/gcp20/prototype/print_job_handler.h +++ b/cloud_print/gcp20/prototype/print_job_handler.h @@ -8,7 +8,7 @@ #include <map> #include <string> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h" diff --git a/cloud_print/gcp20/prototype/printer.cc b/cloud_print/gcp20/prototype/printer.cc index fe01e59..4b91f16 100644 --- a/cloud_print/gcp20/prototype/printer.cc +++ b/cloud_print/gcp20/prototype/printer.cc @@ -5,6 +5,8 @@ #include "cloud_print/gcp20/prototype/printer.h" #include <limits.h> +#include <stddef.h> +#include <stdint.h> #include <stdio.h> #include <algorithm> #include <string> @@ -34,8 +36,8 @@ const char kPrinterStatePathDefault[] = "printer_state.json"; namespace { -const uint16 kHttpPortDefault = 10101; -const uint32 kTtlDefault = 60*60; // in seconds +const uint16_t kHttpPortDefault = 10101; +const uint32_t kTtlDefault = 60 * 60; // in seconds const char kServiceType[] = "_privet._tcp.local"; const char kSecondaryServiceType[] = "_printer._sub._privet._tcp.local"; @@ -681,8 +683,8 @@ void Printer::RememberAccessToken(const std::string& access_token, using base::Time; using base::TimeDelta; state_.access_token = access_token; - int64 time_to_update = static_cast<int64>(expires_in_seconds * - kTimeToNextAccessTokenUpdate); + int64_t time_to_update = + static_cast<int64_t>(expires_in_seconds * kTimeToNextAccessTokenUpdate); state_.access_token_update = Time::Now() + TimeDelta::FromSeconds(time_to_update); VLOG(0) << "Current access_token: " << access_token; @@ -852,7 +854,7 @@ bool Printer::StartDnsServer() { return false; } - uint16 port = command_line_reader::ReadHttpPort(kHttpPortDefault); + uint16_t port = command_line_reader::ReadHttpPort(kHttpPortDefault); VLOG_IF(0, !ipv4.empty()) << "Local IPv4 address: " << net::IPAddressToStringWithPort(ipv4, port); diff --git a/cloud_print/gcp20/prototype/printer.h b/cloud_print/gcp20/prototype/printer.h index 26e6832..bfcb16e 100644 --- a/cloud_print/gcp20/prototype/printer.h +++ b/cloud_print/gcp20/prototype/printer.h @@ -10,6 +10,7 @@ #include "base/files/file_path.h" #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "cloud_print/gcp20/prototype/cloud_print_requester.h" #include "cloud_print/gcp20/prototype/cloud_print_xmpp_listener.h" diff --git a/cloud_print/gcp20/prototype/printer_unittest.cc b/cloud_print/gcp20/prototype/printer_unittest.cc index 5c0acac..1f189f6 100644 --- a/cloud_print/gcp20/prototype/printer_unittest.cc +++ b/cloud_print/gcp20/prototype/printer_unittest.cc @@ -4,7 +4,6 @@ #include "cloud_print/gcp20/prototype/printer.h" -#include "base/basictypes.h" #include "base/json/json_reader.h" #include "base/memory/scoped_ptr.h" #include "base/values.h" diff --git a/cloud_print/gcp20/prototype/privet_http_server.cc b/cloud_print/gcp20/prototype/privet_http_server.cc index 90b45a8..52716f2 100644 --- a/cloud_print/gcp20/prototype/privet_http_server.cc +++ b/cloud_print/gcp20/prototype/privet_http_server.cc @@ -4,6 +4,9 @@ #include "cloud_print/gcp20/prototype/privet_http_server.h" +#include <stddef.h> +#include <stdint.h> + #include "base/command_line.h" #include "base/json/json_writer.h" #include "base/strings/stringprintf.h" @@ -102,7 +105,7 @@ PrivetHttpServer::~PrivetHttpServer() { Shutdown(); } -bool PrivetHttpServer::Start(uint16 port) { +bool PrivetHttpServer::Start(uint16_t port) { if (server_) return true; @@ -370,7 +373,7 @@ scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessSubmitDoc( response->SetString("job_type", job.content_type); response->SetString( "job_size", - base::StringPrintf("%u", static_cast<uint32>(job.content.size()))); + base::StringPrintf("%u", static_cast<uint32_t>(job.content.size()))); if (job_name_present) response->SetString("job_name", job.job_name); return response.Pass(); diff --git a/cloud_print/gcp20/prototype/privet_http_server.h b/cloud_print/gcp20/prototype/privet_http_server.h index 18320e3..f5c815a 100644 --- a/cloud_print/gcp20/prototype/privet_http_server.h +++ b/cloud_print/gcp20/prototype/privet_http_server.h @@ -5,10 +5,12 @@ #ifndef CLOUD_PRINT_GCP20_PROTOTYPE_PRIVET_HTTP_SERVER_H_ #define CLOUD_PRINT_GCP20_PROTOTYPE_PRIVET_HTTP_SERVER_H_ +#include <stdint.h> + #include <string> #include <vector> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/values.h" #include "cloud_print/gcp20/prototype/local_print_job.h" #include "net/server/http_server.h" @@ -134,7 +136,7 @@ class PrivetHttpServer: public net::HttpServer::Delegate { ~PrivetHttpServer() override; // Starts HTTP server: start listening port |port| for HTTP requests. - bool Start(uint16 port); + bool Start(uint16_t port); // Stops HTTP server. void Shutdown(); @@ -201,7 +203,7 @@ class PrivetHttpServer: public net::HttpServer::Delegate { // Port for listening. - uint16 port_; + uint16_t port_; // Contains encapsulated object for listening for requests. scoped_ptr<net::HttpServer> server_; diff --git a/cloud_print/gcp20/prototype/service_parameters.cc b/cloud_print/gcp20/prototype/service_parameters.cc index c15be13..ac663f2 100644 --- a/cloud_print/gcp20/prototype/service_parameters.cc +++ b/cloud_print/gcp20/prototype/service_parameters.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stdint.h> + #include "cloud_print/gcp20/prototype/service_parameters.h" ServiceParameters::ServiceParameters() : http_port_(0) { @@ -16,12 +18,11 @@ ServiceParameters::ServiceParameters(const std::string& service_type, const std::string& service_domain_name, const net::IPAddressNumber& http_ipv4, const net::IPAddressNumber& http_ipv6, - uint16 http_port) + uint16_t http_port) : service_type_(service_type), secondary_service_type_(secondary_service_type), service_name_(service_name_prefix + "." + service_type), service_domain_name_(service_domain_name), http_ipv4_(http_ipv4), http_ipv6_(http_ipv6), - http_port_(http_port) { -} + http_port_(http_port) {} diff --git a/cloud_print/gcp20/prototype/service_parameters.h b/cloud_print/gcp20/prototype/service_parameters.h index ced8846..b1d1d8f 100644 --- a/cloud_print/gcp20/prototype/service_parameters.h +++ b/cloud_print/gcp20/prototype/service_parameters.h @@ -5,6 +5,8 @@ #ifndef CLOUD_PRINT_GCP20_PROTOTYPE_SERVICE_PARAMETERS_H_ #define CLOUD_PRINT_GCP20_PROTOTYPE_SERVICE_PARAMETERS_H_ +#include <stdint.h> + #include <string> #include "net/base/ip_address_number.h" @@ -21,7 +23,7 @@ struct ServiceParameters { const std::string& service_domain_name, const net::IPAddressNumber& http_ipv4, const net::IPAddressNumber& http_ipv6, - uint16 http_port); + uint16_t http_port); std::string service_type_; std::string secondary_service_type_; @@ -29,7 +31,7 @@ struct ServiceParameters { std::string service_domain_name_; net::IPAddressNumber http_ipv4_; net::IPAddressNumber http_ipv6_; - uint16 http_port_; + uint16_t http_port_; }; #endif // CLOUD_PRINT_GCP20_PROTOTYPE_SERVICE_PARAMETERS_H_ diff --git a/cloud_print/gcp20/prototype/x_privet_token.cc b/cloud_print/gcp20/prototype/x_privet_token.cc index 4093ccb..d14d9a6 100644 --- a/cloud_print/gcp20/prototype/x_privet_token.cc +++ b/cloud_print/gcp20/prototype/x_privet_token.cc @@ -4,6 +4,9 @@ #include "cloud_print/gcp20/prototype/x_privet_token.h" +#include <stddef.h> +#include <stdint.h> + #include "base/base64.h" #include "base/format_macros.h" #include "base/guid.h" @@ -15,8 +18,8 @@ namespace { const char kXPrivetTokenDelimeter = ':'; -const uint64 kTimeExpiration = 24*60*60; // in seconds -const uint64 kTimeSecretRefresh = 24*60*60; // in seconds +const uint64_t kTimeExpiration = 24 * 60 * 60; // in seconds +const uint64_t kTimeSecretRefresh = 24 * 60 * 60; // in seconds } // namespace @@ -37,7 +40,7 @@ std::string XPrivetToken::GenerateXToken() { if (Time::Now() > last_gen_time_ + TimeDelta::FromSeconds(kTimeSecretRefresh)) UpdateSecret(); - return GenerateXTokenWithTime(static_cast<uint64>(Time::Now().ToTimeT())); + return GenerateXTokenWithTime(static_cast<uint64_t>(Time::Now().ToTimeT())); } bool XPrivetToken::CheckValidXToken(const std::string& token) const { @@ -46,7 +49,7 @@ bool XPrivetToken::CheckValidXToken(const std::string& token) const { return false; std::string issue_time_str = token.substr(delimeter_pos + 1); - uint64 issue_time; + uint64_t issue_time; if (!base::StringToUint64(issue_time_str, &issue_time)) return false; @@ -57,7 +60,7 @@ bool XPrivetToken::CheckValidXToken(const std::string& token) const { TimeDelta::FromSeconds(kTimeExpiration); } -std::string XPrivetToken::GenerateXTokenWithTime(uint64 issue_time) const { +std::string XPrivetToken::GenerateXTokenWithTime(uint64_t issue_time) const { std::string result; std::string issue_time_str = base::StringPrintf("%" PRIu64, issue_time); std::string hash = base::SHA1HashString(secret_ + diff --git a/cloud_print/gcp20/prototype/x_privet_token.h b/cloud_print/gcp20/prototype/x_privet_token.h index 58c90f8..af0341f 100644 --- a/cloud_print/gcp20/prototype/x_privet_token.h +++ b/cloud_print/gcp20/prototype/x_privet_token.h @@ -5,9 +5,10 @@ #ifndef CLOUD_PRINT_GCP20_PROTOTYPE_X_PRIVET_TOKEN_H_ #define CLOUD_PRINT_GCP20_PROTOTYPE_X_PRIVET_TOKEN_H_ +#include <stdint.h> + #include <string> -#include "base/basictypes.h" #include "base/gtest_prod_util.h" #include "base/time/time.h" @@ -36,7 +37,7 @@ class XPrivetToken { XPrivetToken(const std::string& secret, const base::Time& gen_time); // Generates X-Privet-Token for with certain time of issue. - std::string GenerateXTokenWithTime(uint64 issue_time) const; + std::string GenerateXTokenWithTime(uint64_t issue_time) const; // Creates new XPrivetToken secret. void UpdateSecret(); diff --git a/cloud_print/gcp20/prototype/x_privet_token_unittest.cc b/cloud_print/gcp20/prototype/x_privet_token_unittest.cc index 38d783b..0cf17c6 100644 --- a/cloud_print/gcp20/prototype/x_privet_token_unittest.cc +++ b/cloud_print/gcp20/prototype/x_privet_token_unittest.cc @@ -4,10 +4,10 @@ #include "cloud_print/gcp20/prototype/x_privet_token.h" +#include <stdint.h> #include <stdio.h> #include "base/base64.h" -#include "base/basictypes.h" #include "base/format_macros.h" #include "base/logging.h" #include "base/sha1.h" @@ -18,8 +18,8 @@ TEST(XPrivetTokenTest, Generation) { std::string secret = "E3E92296-E290-4E77-B678-6AEF256C30C8"; - uint64 gen_time = 1372444784; - uint64 issue_time = gen_time; + uint64_t gen_time = 1372444784; + uint64_t issue_time = gen_time; XPrivetToken xtoken(secret, base::Time::FromTimeT(gen_time)); diff --git a/cloud_print/service/service_state.cc b/cloud_print/service/service_state.cc index 471b939..33d771d 100644 --- a/cloud_print/service/service_state.cc +++ b/cloud_print/service/service_state.cc @@ -4,6 +4,8 @@ #include "cloud_print/service/service_state.h" +#include <stdint.h> + #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/logging.h" @@ -35,7 +37,7 @@ const char kXmppAuthTokenOptionName[] = "xmpp_auth_token"; const char kClientLoginUrl[] = "https://www.google.com/accounts/ClientLogin"; -const int64 kRequestTimeoutMs = 10 * 1000; +const int64_t kRequestTimeoutMs = 10 * 1000; class ServiceStateURLRequestDelegate : public net::URLRequest::Delegate { public: diff --git a/cloud_print/service/service_state.h b/cloud_print/service/service_state.h index 2c051f6..d3e41ee 100644 --- a/cloud_print/service/service_state.h +++ b/cloud_print/service/service_state.h @@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/values.h" diff --git a/cloud_print/service/service_state_unittest.cc b/cloud_print/service/service_state_unittest.cc index b0f0029..d168e8c 100644 --- a/cloud_print/service/service_state_unittest.cc +++ b/cloud_print/service/service_state_unittest.cc @@ -4,6 +4,7 @@ #include "cloud_print/service/service_state.h" +#include "base/macros.h" #include "base/strings/string_util.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/cloud_print/service/win/chrome_launcher.cc b/cloud_print/service/win/chrome_launcher.cc index c6acb22..8966a20 100644 --- a/cloud_print/service/win/chrome_launcher.cc +++ b/cloud_print/service/win/chrome_launcher.cc @@ -4,6 +4,8 @@ #include "cloud_print/service/win/chrome_launcher.h" +#include <stddef.h> + #include "base/base_switches.h" #include "base/command_line.h" #include "base/files/file_util.h" diff --git a/cloud_print/service/win/chrome_launcher.h b/cloud_print/service/win/chrome_launcher.h index 189bbc7..b7635df 100644 --- a/cloud_print/service/win/chrome_launcher.h +++ b/cloud_print/service/win/chrome_launcher.h @@ -8,8 +8,8 @@ #include <string> #include <vector> -#include "base/basictypes.h" #include "base/files/file_path.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/threading/simple_thread.h" diff --git a/cloud_print/service/win/cloud_print_service.cc b/cloud_print/service/win/cloud_print_service.cc index 8c5a4a0..6aa7f92 100644 --- a/cloud_print/service/win/cloud_print_service.cc +++ b/cloud_print/service/win/cloud_print_service.cc @@ -9,6 +9,7 @@ #include <atlbase.h> #pragma warning(pop) #include <security.h> +#include <stddef.h> #include <iomanip> #include <iostream> diff --git a/cloud_print/service/win/cloud_print_service_config.cc b/cloud_print/service/win/cloud_print_service_config.cc index 76e9863..c65638a 100644 --- a/cloud_print/service/win/cloud_print_service_config.cc +++ b/cloud_print/service/win/cloud_print_service_config.cc @@ -4,6 +4,8 @@ #include <atlbase.h> #include <atlapp.h> // NOLINT +#include <stddef.h> +#include <stdint.h> #include "base/at_exit.h" #include "base/bind.h" diff --git a/cloud_print/service/win/local_security_policy.cc b/cloud_print/service/win/local_security_policy.cc index e9830b3..8718dd0 100644 --- a/cloud_print/service/win/local_security_policy.cc +++ b/cloud_print/service/win/local_security_policy.cc @@ -7,8 +7,10 @@ #include <atlsecurity.h> #include <ntsecapi.h> #include <windows.h> +#include <stddef.h> #include "base/logging.h" +#include "base/macros.h" #include "base/strings/string_util.h" const wchar_t kSeServiceLogonRight[] = L"SeServiceLogonRight"; diff --git a/cloud_print/service/win/local_security_policy.h b/cloud_print/service/win/local_security_policy.h index a0c58a0..7dbdb75 100644 --- a/cloud_print/service/win/local_security_policy.h +++ b/cloud_print/service/win/local_security_policy.h @@ -8,7 +8,7 @@ #include <wtypes.h> // Has to be before ntsecapi.h #include <ntsecapi.h> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/strings/string16.h" extern const wchar_t kSeServiceLogonRight[]; diff --git a/cloud_print/service/win/service_controller.cc b/cloud_print/service/win/service_controller.cc index 9775752..2af87ec 100644 --- a/cloud_print/service/win/service_controller.cc +++ b/cloud_print/service/win/service_controller.cc @@ -7,11 +7,13 @@ #include <atlbase.h> #include <atlcom.h> #include <atlctl.h> +#include <stdint.h> #include "base/base_switches.h" #include "base/command_line.h" #include "base/files/file_path.h" #include "base/files/file_util.h" +#include "base/macros.h" #include "base/path_service.h" #include "base/win/scoped_handle.h" #include "chrome/common/chrome_switches.h" @@ -297,7 +299,7 @@ void ServiceController::UpdateState() { if (!config_size) return; - std::vector<uint8> buffer(config_size, 0); + std::vector<uint8_t> buffer(config_size, 0); QUERY_SERVICE_CONFIG* config = reinterpret_cast<QUERY_SERVICE_CONFIG*>(&buffer[0]); if (!::QueryServiceConfig(service.Get(), config, diff --git a/cloud_print/service/win/service_listener.cc b/cloud_print/service/win/service_listener.cc index 31173c7..faf9ca3 100644 --- a/cloud_print/service/win/service_listener.cc +++ b/cloud_print/service/win/service_listener.cc @@ -4,6 +4,9 @@ #include "cloud_print/service/win/service_listener.h" +#include <stddef.h> +#include <stdint.h> + #include "base/bind.h" #include "base/files/file_path.h" #include "base/files/file_util.h" @@ -75,7 +78,7 @@ bool ServiceListener::OnMessageReceived(const IPC::Message& msg) { return true; } -void ServiceListener::OnChannelConnected(int32 peer_pid) { +void ServiceListener::OnChannelConnected(int32_t peer_pid) { IPC::Message* message = new IPC::Message(0, 0, IPC::Message::PRIORITY_NORMAL); message->WriteString(GetEnvironment(user_data_dir_)); channel_->Send(message); diff --git a/cloud_print/service/win/service_listener.h b/cloud_print/service/win/service_listener.h index 7344edd..15cf06f 100644 --- a/cloud_print/service/win/service_listener.h +++ b/cloud_print/service/win/service_listener.h @@ -5,6 +5,8 @@ #ifndef CLOUD_PRINT_SERVICE_SERVICE_LISTENER_H_ #define CLOUD_PRINT_SERVICE_SERVICE_LISTENER_H_ +#include <stdint.h> + #include "base/compiler_specific.h" #include "base/files/file_path.h" #include "base/memory/scoped_ptr.h" @@ -26,7 +28,7 @@ class ServiceListener : public IPC::Listener { ~ServiceListener() override; bool OnMessageReceived(const IPC::Message& msg) override; - void OnChannelConnected(int32 peer_pid) override; + void OnChannelConnected(int32_t peer_pid) override; private: void Disconnect(); diff --git a/cloud_print/service/win/setup_listener.cc b/cloud_print/service/win/setup_listener.cc index c4ffc79..549cad5 100644 --- a/cloud_print/service/win/setup_listener.cc +++ b/cloud_print/service/win/setup_listener.cc @@ -6,6 +6,7 @@ #include <atlbase.h> #include <atlsecurity.h> +#include <stddef.h> #include "base/bind.h" #include "base/guid.h" diff --git a/cloud_print/virtual_driver/win/install/setup.cc b/cloud_print/virtual_driver/win/install/setup.cc index c7fc3a5..afb5954 100644 --- a/cloud_print/virtual_driver/win/install/setup.cc +++ b/cloud_print/virtual_driver/win/install/setup.cc @@ -5,6 +5,8 @@ #include <windows.h> #include <setupapi.h> // Must be included after windows.h #include <winspool.h> +#include <stddef.h> + #include <iomanip> #include "base/at_exit.h" diff --git a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc b/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc index e52e332..e9cb31f 100644 --- a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc +++ b/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc @@ -8,6 +8,8 @@ #include <lmcons.h> #include <shellapi.h> #include <shlobj.h> +#include <stddef.h> +#include <stdint.h> #include <strsafe.h> #include <userenv.h> #include <winspool.h> @@ -574,7 +576,7 @@ BOOL WINAPI Monitor2EndDocPort(HANDLE port_handle) { base::CloseFile(port_data->file); port_data->file = NULL; bool delete_file = true; - int64 file_size = 0; + int64_t file_size = 0; base::GetFileSize(port_data->file_path, &file_size); if (file_size > 0) { base::string16 job_title; diff --git a/cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc b/cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc index 5df48a0..ef60468 100644 --- a/cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc +++ b/cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc @@ -4,9 +4,11 @@ #include "cloud_print/virtual_driver/win/port_monitor/port_monitor.h" +#include <stddef.h> #include <winspool.h> #include "base/files/file_util.h" +#include "base/macros.h" #include "base/path_service.h" #include "base/strings/string16.h" #include "base/win/registry.h" diff --git a/cloud_print/virtual_driver/win/virtual_driver_consts.cc b/cloud_print/virtual_driver/win/virtual_driver_consts.cc index 5ce4fc1..eb64a9c 100644 --- a/cloud_print/virtual_driver/win/virtual_driver_consts.cc +++ b/cloud_print/virtual_driver/win/virtual_driver_consts.cc @@ -3,7 +3,10 @@ // found in the LICENSE file. #include "cloud_print/virtual_driver/win/virtual_driver_consts.h" + #include <windows.h> +#include <stddef.h> + #include "cloud_print/virtual_driver/win/virtual_driver_helpers.h" namespace cloud_print { |