| 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 "chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_pr
ivate_api.h" | 5 #include "chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_pr
ivate_api.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/hash.h" | 8 #include "base/hash.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 SendResponse(success); | 121 SendResponse(success); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void WebrtcLoggingPrivateFunctionWithUploadCallback::FireCallback( | 124 void WebrtcLoggingPrivateFunctionWithUploadCallback::FireCallback( |
| 125 bool success, const std::string& report_id, | 125 bool success, const std::string& report_id, |
| 126 const std::string& error_message) { | 126 const std::string& error_message) { |
| 127 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 127 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 128 if (success) { | 128 if (success) { |
| 129 api::webrtc_logging_private::UploadResult result; | 129 api::webrtc_logging_private::UploadResult result; |
| 130 result.report_id = report_id; | 130 result.report_id = report_id; |
| 131 SetResult(result.ToValue().release()); | 131 SetResult(result.ToValue()); |
| 132 } else { | 132 } else { |
| 133 SetError(error_message); | 133 SetError(error_message); |
| 134 } | 134 } |
| 135 SendResponse(success); | 135 SendResponse(success); |
| 136 } | 136 } |
| 137 | 137 |
| 138 void WebrtcLoggingPrivateFunctionWithRecordingDoneCallback::FireErrorCallback( | 138 void WebrtcLoggingPrivateFunctionWithRecordingDoneCallback::FireErrorCallback( |
| 139 const std::string& error_message) { | 139 const std::string& error_message) { |
| 140 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 140 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 141 SetError(error_message); | 141 SetError(error_message); |
| 142 SendResponse(false); | 142 SendResponse(false); |
| 143 } | 143 } |
| 144 | 144 |
| 145 void WebrtcLoggingPrivateFunctionWithRecordingDoneCallback::FireCallback( | 145 void WebrtcLoggingPrivateFunctionWithRecordingDoneCallback::FireCallback( |
| 146 const std::string& prefix_path, | 146 const std::string& prefix_path, |
| 147 bool did_stop, | 147 bool did_stop, |
| 148 bool did_manual_stop) { | 148 bool did_manual_stop) { |
| 149 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 149 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 150 api::webrtc_logging_private::RecordingInfo result; | 150 api::webrtc_logging_private::RecordingInfo result; |
| 151 result.prefix_path = prefix_path; | 151 result.prefix_path = prefix_path; |
| 152 result.did_stop = did_stop; | 152 result.did_stop = did_stop; |
| 153 result.did_manual_stop = did_manual_stop; | 153 result.did_manual_stop = did_manual_stop; |
| 154 SetResult(result.ToValue().release()); | 154 SetResult(result.ToValue()); |
| 155 SendResponse(true); | 155 SendResponse(true); |
| 156 } | 156 } |
| 157 | 157 |
| 158 bool WebrtcLoggingPrivateSetMetaDataFunction::RunAsync() { | 158 bool WebrtcLoggingPrivateSetMetaDataFunction::RunAsync() { |
| 159 std::unique_ptr<SetMetaData::Params> params( | 159 std::unique_ptr<SetMetaData::Params> params( |
| 160 SetMetaData::Params::Create(*args_)); | 160 SetMetaData::Params::Create(*args_)); |
| 161 EXTENSION_FUNCTION_VALIDATE(params.get()); | 161 EXTENSION_FUNCTION_VALIDATE(params.get()); |
| 162 | 162 |
| 163 WebRtcLoggingHandlerHost::GenericDoneCallback callback; | 163 WebRtcLoggingHandlerHost::GenericDoneCallback callback; |
| 164 scoped_refptr<WebRtcLoggingHandlerHost> webrtc_logging_handler_host = | 164 scoped_refptr<WebRtcLoggingHandlerHost> webrtc_logging_handler_host = |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 base::Bind( | 509 base::Bind( |
| 510 &WebrtcLoggingPrivateStopWebRtcEventLoggingFunction::FireCallback, | 510 &WebrtcLoggingPrivateStopWebRtcEventLoggingFunction::FireCallback, |
| 511 this), | 511 this), |
| 512 base::Bind( | 512 base::Bind( |
| 513 &WebrtcLoggingPrivateStopWebRtcEventLoggingFunction::FireErrorCallback, | 513 &WebrtcLoggingPrivateStopWebRtcEventLoggingFunction::FireErrorCallback, |
| 514 this)); | 514 this)); |
| 515 return true; | 515 return true; |
| 516 } | 516 } |
| 517 | 517 |
| 518 } // namespace extensions | 518 } // namespace extensions |
| OLD | NEW |