| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/copresence/rpc/rpc_handler.h" | 5 #include "components/copresence/rpc/rpc_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 #include <stdint.h> |
| 9 |
| 7 #include "base/bind.h" | 10 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 12 #include "base/logging.h" |
| 10 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 11 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
| 15 #include "build/build_config.h" |
| 12 | 16 |
| 13 // TODO(ckehoe): time.h includes windows.h, which #defines DeviceCapabilities | 17 // TODO(ckehoe): time.h includes windows.h, which #defines DeviceCapabilities |
| 14 // to DeviceCapabilitiesW. This breaks the pb.h headers below. For now, | 18 // to DeviceCapabilitiesW. This breaks the pb.h headers below. For now, |
| 15 // we fix this with an #undef. | 19 // we fix this with an #undef. |
| 16 #include "base/time/time.h" | 20 #include "base/time/time.h" |
| 17 #if defined(OS_WIN) | 21 #if defined(OS_WIN) |
| 18 #undef DeviceCapabilities | 22 #undef DeviceCapabilities |
| 19 #endif | 23 #endif |
| 20 | 24 |
| 21 #include "components/audio_modem/public/audio_modem_types.h" | 25 #include "components/audio_modem/public/audio_modem_types.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 state->mutable_capabilities()->add_token_technology(); | 135 state->mutable_capabilities()->add_token_technology(); |
| 132 audible->set_medium(AUDIO_AUDIBLE_DTMF); | 136 audible->set_medium(AUDIO_AUDIBLE_DTMF); |
| 133 audible->add_instruction_type(TRANSMIT); | 137 audible->add_instruction_type(TRANSMIT); |
| 134 audible->add_instruction_type(RECEIVE); | 138 audible->add_instruction_type(RECEIVE); |
| 135 | 139 |
| 136 return state.Pass(); | 140 return state.Pass(); |
| 137 } | 141 } |
| 138 | 142 |
| 139 // TODO(ckehoe): We're keeping this code in a separate function for now | 143 // TODO(ckehoe): We're keeping this code in a separate function for now |
| 140 // because we get a version string from Chrome, but the proto expects | 144 // because we get a version string from Chrome, but the proto expects |
| 141 // an int64 version. We should probably change the version proto | 145 // an int64_t version. We should probably change the version proto |
| 142 // to handle a more detailed version. | 146 // to handle a more detailed version. |
| 143 ClientVersion* CreateVersion(const std::string& client, | 147 ClientVersion* CreateVersion(const std::string& client, |
| 144 const std::string& version_name) { | 148 const std::string& version_name) { |
| 145 ClientVersion* version = new ClientVersion; | 149 ClientVersion* version = new ClientVersion; |
| 146 version->set_client(client); | 150 version->set_client(client); |
| 147 version->set_version_name(version_name); | 151 version->set_version_name(version_name); |
| 148 return version; | 152 return version; |
| 149 } | 153 } |
| 150 | 154 |
| 151 void AddTokenToRequest(const AudioToken& token, ReportRequest* request) { | 155 void AddTokenToRequest(const AudioToken& token, ReportRequest* request) { |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 api_key, | 618 api_key, |
| 615 auth_token, | 619 auth_token, |
| 616 command_line->GetSwitchValueASCII(switches::kCopresenceTracingToken), | 620 command_line->GetSwitchValueASCII(switches::kCopresenceTracingToken), |
| 617 *request_proto); | 621 *request_proto); |
| 618 | 622 |
| 619 http_post->Start(base::Bind(callback, http_post)); | 623 http_post->Start(base::Bind(callback, http_post)); |
| 620 pending_posts_.insert(http_post); | 624 pending_posts_.insert(http_post); |
| 621 } | 625 } |
| 622 | 626 |
| 623 } // namespace copresence | 627 } // namespace copresence |
| OLD | NEW |