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 <string> | 5 #include <string> |
6 | 6 |
7 #include "chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_pr
ivate_api.h" | 7 #include "chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_pr
ivate_api.h" |
8 | 8 |
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( | 88 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( |
89 &WebRtcLoggingHandlerHost::SetMetaData, webrtc_logging_handler_host, | 89 &WebRtcLoggingHandlerHost::SetMetaData, webrtc_logging_handler_host, |
90 meta_data, callback)); | 90 meta_data, callback)); |
91 | 91 |
92 return true; | 92 return true; |
93 } | 93 } |
94 | 94 |
95 void WebrtcLoggingPrivateSetMetaDataFunction::SetMetaDataCallback( | 95 void WebrtcLoggingPrivateSetMetaDataFunction::SetMetaDataCallback( |
96 bool success, const std::string& error_message) { | 96 bool success, const std::string& error_message) { |
97 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 97 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
98 if (!success) | 98 if (!success) |
99 SetError(error_message); | 99 SetError(error_message); |
100 SendResponse(success); | 100 SendResponse(success); |
101 } | 101 } |
102 | 102 |
103 WebrtcLoggingPrivateStartFunction::WebrtcLoggingPrivateStartFunction() {} | 103 WebrtcLoggingPrivateStartFunction::WebrtcLoggingPrivateStartFunction() {} |
104 | 104 |
105 WebrtcLoggingPrivateStartFunction::~WebrtcLoggingPrivateStartFunction() {} | 105 WebrtcLoggingPrivateStartFunction::~WebrtcLoggingPrivateStartFunction() {} |
106 | 106 |
107 bool WebrtcLoggingPrivateStartFunction::RunImpl() { | 107 bool WebrtcLoggingPrivateStartFunction::RunImpl() { |
(...skipping 13 matching lines...) Expand all Loading... |
121 | 121 |
122 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( | 122 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( |
123 &WebRtcLoggingHandlerHost::StartLogging, webrtc_logging_handler_host, | 123 &WebRtcLoggingHandlerHost::StartLogging, webrtc_logging_handler_host, |
124 callback)); | 124 callback)); |
125 | 125 |
126 return true; | 126 return true; |
127 } | 127 } |
128 | 128 |
129 void WebrtcLoggingPrivateStartFunction::StartCallback( | 129 void WebrtcLoggingPrivateStartFunction::StartCallback( |
130 bool success, const std::string& error_message) { | 130 bool success, const std::string& error_message) { |
131 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 131 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
132 if (!success) | 132 if (!success) |
133 SetError(error_message); | 133 SetError(error_message); |
134 SendResponse(success); | 134 SendResponse(success); |
135 } | 135 } |
136 | 136 |
137 WebrtcLoggingPrivateSetUploadOnRenderCloseFunction:: | 137 WebrtcLoggingPrivateSetUploadOnRenderCloseFunction:: |
138 WebrtcLoggingPrivateSetUploadOnRenderCloseFunction() {} | 138 WebrtcLoggingPrivateSetUploadOnRenderCloseFunction() {} |
139 | 139 |
140 WebrtcLoggingPrivateSetUploadOnRenderCloseFunction:: | 140 WebrtcLoggingPrivateSetUploadOnRenderCloseFunction:: |
141 ~WebrtcLoggingPrivateSetUploadOnRenderCloseFunction() {} | 141 ~WebrtcLoggingPrivateSetUploadOnRenderCloseFunction() {} |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 180 |
181 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( | 181 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( |
182 &WebRtcLoggingHandlerHost::StopLogging, webrtc_logging_handler_host, | 182 &WebRtcLoggingHandlerHost::StopLogging, webrtc_logging_handler_host, |
183 callback)); | 183 callback)); |
184 | 184 |
185 return true; | 185 return true; |
186 } | 186 } |
187 | 187 |
188 void WebrtcLoggingPrivateStopFunction::StopCallback( | 188 void WebrtcLoggingPrivateStopFunction::StopCallback( |
189 bool success, const std::string& error_message) { | 189 bool success, const std::string& error_message) { |
190 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 190 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
191 if (!success) | 191 if (!success) |
192 SetError(error_message); | 192 SetError(error_message); |
193 SendResponse(success); | 193 SendResponse(success); |
194 } | 194 } |
195 | 195 |
196 WebrtcLoggingPrivateUploadFunction::WebrtcLoggingPrivateUploadFunction() {} | 196 WebrtcLoggingPrivateUploadFunction::WebrtcLoggingPrivateUploadFunction() {} |
197 | 197 |
198 WebrtcLoggingPrivateUploadFunction::~WebrtcLoggingPrivateUploadFunction() {} | 198 WebrtcLoggingPrivateUploadFunction::~WebrtcLoggingPrivateUploadFunction() {} |
199 | 199 |
200 bool WebrtcLoggingPrivateUploadFunction::RunImpl() { | 200 bool WebrtcLoggingPrivateUploadFunction::RunImpl() { |
(...skipping 14 matching lines...) Expand all Loading... |
215 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( | 215 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( |
216 &WebRtcLoggingHandlerHost::UploadLog, webrtc_logging_handler_host, | 216 &WebRtcLoggingHandlerHost::UploadLog, webrtc_logging_handler_host, |
217 callback)); | 217 callback)); |
218 | 218 |
219 return true; | 219 return true; |
220 } | 220 } |
221 | 221 |
222 void WebrtcLoggingPrivateUploadFunction::UploadCallback( | 222 void WebrtcLoggingPrivateUploadFunction::UploadCallback( |
223 bool success, const std::string& report_id, | 223 bool success, const std::string& report_id, |
224 const std::string& error_message) { | 224 const std::string& error_message) { |
225 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 225 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
226 if (success) { | 226 if (success) { |
227 api::webrtc_logging_private::UploadResult result; | 227 api::webrtc_logging_private::UploadResult result; |
228 result.report_id = report_id; | 228 result.report_id = report_id; |
229 SetResult(result.ToValue().release()); | 229 SetResult(result.ToValue().release()); |
230 } else { | 230 } else { |
231 SetError(error_message); | 231 SetError(error_message); |
232 } | 232 } |
233 SendResponse(success); | 233 SendResponse(success); |
234 } | 234 } |
235 | 235 |
(...skipping 18 matching lines...) Expand all Loading... |
254 | 254 |
255 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( | 255 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( |
256 &WebRtcLoggingHandlerHost::DiscardLog, webrtc_logging_handler_host, | 256 &WebRtcLoggingHandlerHost::DiscardLog, webrtc_logging_handler_host, |
257 callback)); | 257 callback)); |
258 | 258 |
259 return true; | 259 return true; |
260 } | 260 } |
261 | 261 |
262 void WebrtcLoggingPrivateDiscardFunction::DiscardCallback( | 262 void WebrtcLoggingPrivateDiscardFunction::DiscardCallback( |
263 bool success, const std::string& error_message) { | 263 bool success, const std::string& error_message) { |
264 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 264 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
265 if (!success) | 265 if (!success) |
266 SetError(error_message); | 266 SetError(error_message); |
267 SendResponse(success); | 267 SendResponse(success); |
268 } | 268 } |
269 | 269 |
270 } // namespace extensions | 270 } // namespace extensions |
OLD | NEW |