| 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEBRTC_LOGGING_PRIVATE_WEBRTC_LOGGING_PRIV
ATE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEBRTC_LOGGING_PRIVATE_WEBRTC_LOGGING_PRIV
ATE_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_WEBRTC_LOGGING_PRIVATE_WEBRTC_LOGGING_PRIV
ATE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_WEBRTC_LOGGING_PRIVATE_WEBRTC_LOGGING_PRIV
ATE_API_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/extensions/chrome_extension_function.h" | 8 #include "chrome/browser/extensions/chrome_extension_function.h" |
| 9 #include "chrome/common/extensions/api/webrtc_logging_private.h" | 9 #include "chrome/common/extensions/api/webrtc_logging_private.h" |
| 10 | 10 |
| 11 namespace content { | 11 namespace content { |
| 12 | 12 |
| 13 class RenderProcessHost; | 13 class RenderProcessHost; |
| 14 | 14 |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace extensions { | 17 namespace extensions { |
| 18 | 18 |
| 19 // TODO(grunell). Merge this with WebrtcAudioPrivateTabIdFunction. | 19 // TODO(grunell). Merge this with WebrtcAudioPrivateTabIdFunction. |
| 20 class WebrtcLoggingPrivateTabIdFunction : public ChromeAsyncExtensionFunction { | 20 class WebrtcLoggingPrivateTabIdFunction : public ChromeAsyncExtensionFunction { |
| 21 protected: | 21 protected: |
| 22 virtual ~WebrtcLoggingPrivateTabIdFunction() {} | 22 ~WebrtcLoggingPrivateTabIdFunction() override {} |
| 23 | 23 |
| 24 content::RenderProcessHost* RphFromTabIdAndSecurityOrigin( | 24 content::RenderProcessHost* RphFromTabIdAndSecurityOrigin( |
| 25 int tab_id, const std::string& security_origin); | 25 int tab_id, const std::string& security_origin); |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 class WebrtcLoggingPrivateSetMetaDataFunction | 28 class WebrtcLoggingPrivateSetMetaDataFunction |
| 29 : public WebrtcLoggingPrivateTabIdFunction { | 29 : public WebrtcLoggingPrivateTabIdFunction { |
| 30 public: | 30 public: |
| 31 DECLARE_EXTENSION_FUNCTION("webrtcLoggingPrivate.setMetaData", | 31 DECLARE_EXTENSION_FUNCTION("webrtcLoggingPrivate.setMetaData", |
| 32 WEBRTCLOGGINGPRIVATE_SETMETADATA) | 32 WEBRTCLOGGINGPRIVATE_SETMETADATA) |
| 33 WebrtcLoggingPrivateSetMetaDataFunction(); | 33 WebrtcLoggingPrivateSetMetaDataFunction(); |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 virtual ~WebrtcLoggingPrivateSetMetaDataFunction(); | 36 ~WebrtcLoggingPrivateSetMetaDataFunction() override; |
| 37 | 37 |
| 38 // ExtensionFunction overrides. | 38 // ExtensionFunction overrides. |
| 39 virtual bool RunAsync() override; | 39 bool RunAsync() override; |
| 40 | 40 |
| 41 // Must be called on UI thread. | 41 // Must be called on UI thread. |
| 42 void SetMetaDataCallback(bool success, const std::string& error_message); | 42 void SetMetaDataCallback(bool success, const std::string& error_message); |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 class WebrtcLoggingPrivateStartFunction | 45 class WebrtcLoggingPrivateStartFunction |
| 46 : public WebrtcLoggingPrivateTabIdFunction { | 46 : public WebrtcLoggingPrivateTabIdFunction { |
| 47 public: | 47 public: |
| 48 DECLARE_EXTENSION_FUNCTION("webrtcLoggingPrivate.start", | 48 DECLARE_EXTENSION_FUNCTION("webrtcLoggingPrivate.start", |
| 49 WEBRTCLOGGINGPRIVATE_START) | 49 WEBRTCLOGGINGPRIVATE_START) |
| 50 WebrtcLoggingPrivateStartFunction(); | 50 WebrtcLoggingPrivateStartFunction(); |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 virtual ~WebrtcLoggingPrivateStartFunction(); | 53 ~WebrtcLoggingPrivateStartFunction() override; |
| 54 | 54 |
| 55 // ExtensionFunction overrides. | 55 // ExtensionFunction overrides. |
| 56 virtual bool RunAsync() override; | 56 bool RunAsync() override; |
| 57 | 57 |
| 58 // Must be called on UI thread. | 58 // Must be called on UI thread. |
| 59 void StartCallback(bool success, const std::string& error_message); | 59 void StartCallback(bool success, const std::string& error_message); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 class WebrtcLoggingPrivateSetUploadOnRenderCloseFunction | 62 class WebrtcLoggingPrivateSetUploadOnRenderCloseFunction |
| 63 : public WebrtcLoggingPrivateTabIdFunction { | 63 : public WebrtcLoggingPrivateTabIdFunction { |
| 64 public: | 64 public: |
| 65 DECLARE_EXTENSION_FUNCTION("webrtcLoggingPrivate.setUploadOnRenderClose", | 65 DECLARE_EXTENSION_FUNCTION("webrtcLoggingPrivate.setUploadOnRenderClose", |
| 66 WEBRTCLOGGINGPRIVATE_SETUPLOADONRENDERCLOSE) | 66 WEBRTCLOGGINGPRIVATE_SETUPLOADONRENDERCLOSE) |
| 67 WebrtcLoggingPrivateSetUploadOnRenderCloseFunction(); | 67 WebrtcLoggingPrivateSetUploadOnRenderCloseFunction(); |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 virtual ~WebrtcLoggingPrivateSetUploadOnRenderCloseFunction(); | 70 ~WebrtcLoggingPrivateSetUploadOnRenderCloseFunction() override; |
| 71 | 71 |
| 72 // ExtensionFunction overrides. | 72 // ExtensionFunction overrides. |
| 73 virtual bool RunAsync() override; | 73 bool RunAsync() override; |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 class WebrtcLoggingPrivateStopFunction | 76 class WebrtcLoggingPrivateStopFunction |
| 77 : public WebrtcLoggingPrivateTabIdFunction { | 77 : public WebrtcLoggingPrivateTabIdFunction { |
| 78 public: | 78 public: |
| 79 DECLARE_EXTENSION_FUNCTION("webrtcLoggingPrivate.stop", | 79 DECLARE_EXTENSION_FUNCTION("webrtcLoggingPrivate.stop", |
| 80 WEBRTCLOGGINGPRIVATE_STOP) | 80 WEBRTCLOGGINGPRIVATE_STOP) |
| 81 WebrtcLoggingPrivateStopFunction(); | 81 WebrtcLoggingPrivateStopFunction(); |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 virtual ~WebrtcLoggingPrivateStopFunction(); | 84 ~WebrtcLoggingPrivateStopFunction() override; |
| 85 | 85 |
| 86 // ExtensionFunction overrides. | 86 // ExtensionFunction overrides. |
| 87 virtual bool RunAsync() override; | 87 bool RunAsync() override; |
| 88 | 88 |
| 89 // Must be called on UI thread. | 89 // Must be called on UI thread. |
| 90 void StopCallback(bool success, const std::string& error_message); | 90 void StopCallback(bool success, const std::string& error_message); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 class WebrtcLoggingPrivateUploadFunction | 93 class WebrtcLoggingPrivateUploadFunction |
| 94 : public WebrtcLoggingPrivateTabIdFunction { | 94 : public WebrtcLoggingPrivateTabIdFunction { |
| 95 public: | 95 public: |
| 96 DECLARE_EXTENSION_FUNCTION("webrtcLoggingPrivate.upload", | 96 DECLARE_EXTENSION_FUNCTION("webrtcLoggingPrivate.upload", |
| 97 WEBRTCLOGGINGPRIVATE_UPLOAD) | 97 WEBRTCLOGGINGPRIVATE_UPLOAD) |
| 98 WebrtcLoggingPrivateUploadFunction(); | 98 WebrtcLoggingPrivateUploadFunction(); |
| 99 | 99 |
| 100 private: | 100 private: |
| 101 virtual ~WebrtcLoggingPrivateUploadFunction(); | 101 ~WebrtcLoggingPrivateUploadFunction() override; |
| 102 | 102 |
| 103 // ExtensionFunction overrides. | 103 // ExtensionFunction overrides. |
| 104 virtual bool RunAsync() override; | 104 bool RunAsync() override; |
| 105 | 105 |
| 106 // Must be called on UI thread. | 106 // Must be called on UI thread. |
| 107 void UploadCallback(bool success, const std::string& report_id, | 107 void UploadCallback(bool success, const std::string& report_id, |
| 108 const std::string& error_message); | 108 const std::string& error_message); |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 class WebrtcLoggingPrivateDiscardFunction | 111 class WebrtcLoggingPrivateDiscardFunction |
| 112 : public WebrtcLoggingPrivateTabIdFunction { | 112 : public WebrtcLoggingPrivateTabIdFunction { |
| 113 public: | 113 public: |
| 114 DECLARE_EXTENSION_FUNCTION("webrtcLoggingPrivate.discard", | 114 DECLARE_EXTENSION_FUNCTION("webrtcLoggingPrivate.discard", |
| 115 WEBRTCLOGGINGPRIVATE_DISCARD) | 115 WEBRTCLOGGINGPRIVATE_DISCARD) |
| 116 WebrtcLoggingPrivateDiscardFunction(); | 116 WebrtcLoggingPrivateDiscardFunction(); |
| 117 | 117 |
| 118 private: | 118 private: |
| 119 virtual ~WebrtcLoggingPrivateDiscardFunction(); | 119 ~WebrtcLoggingPrivateDiscardFunction() override; |
| 120 | 120 |
| 121 // ExtensionFunction overrides. | 121 // ExtensionFunction overrides. |
| 122 virtual bool RunAsync() override; | 122 bool RunAsync() override; |
| 123 | 123 |
| 124 // Must be called on UI thread. | 124 // Must be called on UI thread. |
| 125 void DiscardCallback(bool success, const std::string& error_message); | 125 void DiscardCallback(bool success, const std::string& error_message); |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 class WebrtcLoggingPrivateStartRtpDumpFunction | 128 class WebrtcLoggingPrivateStartRtpDumpFunction |
| 129 : public WebrtcLoggingPrivateTabIdFunction { | 129 : public WebrtcLoggingPrivateTabIdFunction { |
| 130 public: | 130 public: |
| 131 DECLARE_EXTENSION_FUNCTION("webrtcLoggingPrivate.startRtpDump", | 131 DECLARE_EXTENSION_FUNCTION("webrtcLoggingPrivate.startRtpDump", |
| 132 WEBRTCLOGGINGPRIVATE_STARTRTPDUMP) | 132 WEBRTCLOGGINGPRIVATE_STARTRTPDUMP) |
| 133 WebrtcLoggingPrivateStartRtpDumpFunction(); | 133 WebrtcLoggingPrivateStartRtpDumpFunction(); |
| 134 | 134 |
| 135 private: | 135 private: |
| 136 virtual ~WebrtcLoggingPrivateStartRtpDumpFunction(); | 136 ~WebrtcLoggingPrivateStartRtpDumpFunction() override; |
| 137 | 137 |
| 138 // ExtensionFunction overrides. | 138 // ExtensionFunction overrides. |
| 139 virtual bool RunAsync() override; | 139 bool RunAsync() override; |
| 140 | 140 |
| 141 // Must be called on UI thread. | 141 // Must be called on UI thread. |
| 142 void StartRtpDumpCallback(bool success, const std::string& error_message); | 142 void StartRtpDumpCallback(bool success, const std::string& error_message); |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 class WebrtcLoggingPrivateStopRtpDumpFunction | 145 class WebrtcLoggingPrivateStopRtpDumpFunction |
| 146 : public WebrtcLoggingPrivateTabIdFunction { | 146 : public WebrtcLoggingPrivateTabIdFunction { |
| 147 public: | 147 public: |
| 148 DECLARE_EXTENSION_FUNCTION("webrtcLoggingPrivate.stopRtpDump", | 148 DECLARE_EXTENSION_FUNCTION("webrtcLoggingPrivate.stopRtpDump", |
| 149 WEBRTCLOGGINGPRIVATE_STOPRTPDUMP) | 149 WEBRTCLOGGINGPRIVATE_STOPRTPDUMP) |
| 150 WebrtcLoggingPrivateStopRtpDumpFunction(); | 150 WebrtcLoggingPrivateStopRtpDumpFunction(); |
| 151 | 151 |
| 152 private: | 152 private: |
| 153 virtual ~WebrtcLoggingPrivateStopRtpDumpFunction(); | 153 ~WebrtcLoggingPrivateStopRtpDumpFunction() override; |
| 154 | 154 |
| 155 // ExtensionFunction overrides. | 155 // ExtensionFunction overrides. |
| 156 virtual bool RunAsync() override; | 156 bool RunAsync() override; |
| 157 | 157 |
| 158 // Must be called on UI thread. | 158 // Must be called on UI thread. |
| 159 void StopRtpDumpCallback(bool success, const std::string& error_message); | 159 void StopRtpDumpCallback(bool success, const std::string& error_message); |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 } // namespace extensions | 162 } // namespace extensions |
| 163 | 163 |
| 164 #endif // CHROME_BROWSER_EXTENSIONS_API_WEBRTC_LOGGING_PRIVATE_WEBRTC_LOGGING_P
RIVATE_API_H_ | 164 #endif // CHROME_BROWSER_EXTENSIONS_API_WEBRTC_LOGGING_PRIVATE_WEBRTC_LOGGING_P
RIVATE_API_H_ |
| OLD | NEW |