OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_RENDERER_PEPPER_PEPPER_UMA_HOST_H_ |
| 6 #define CHROME_RENDERER_PEPPER_PEPPER_UMA_HOST_H_ |
| 7 |
| 8 #include <set> |
| 9 #include <string> |
| 10 |
| 11 #include "ppapi/c/pp_instance.h" |
| 12 #include "ppapi/c/pp_resource.h" |
| 13 #include "ppapi/host/resource_host.h" |
| 14 #include "url/gurl.h" |
| 15 |
| 16 namespace content { |
| 17 class RendererPpapiHost; |
| 18 } |
| 19 |
| 20 namespace ppapi { |
| 21 namespace host { |
| 22 struct HostMessageContext; |
| 23 } // namespace host |
| 24 } // namespace ppapi |
| 25 |
| 26 class PepperUMAHost : public ppapi::host::ResourceHost { |
| 27 public: |
| 28 PepperUMAHost(content::RendererPpapiHost* host, |
| 29 PP_Instance instance, |
| 30 PP_Resource resource); |
| 31 |
| 32 virtual ~PepperUMAHost(); |
| 33 |
| 34 // ppapi::host::ResourceMessageHandler implementation. |
| 35 virtual int32_t OnResourceMessageReceived( |
| 36 const IPC::Message& msg, |
| 37 ppapi::host::HostMessageContext* context) OVERRIDE; |
| 38 |
| 39 private: |
| 40 bool IsHistogramAllowed(const std::string& histogram); |
| 41 |
| 42 int32_t OnHistogramCustomTimes( |
| 43 ppapi::host::HostMessageContext* context, |
| 44 const std::string& name, |
| 45 int64_t sample, |
| 46 int64_t min, |
| 47 int64_t max, |
| 48 uint32_t bucket_count); |
| 49 |
| 50 int32_t OnHistogramCustomCounts( |
| 51 ppapi::host::HostMessageContext* context, |
| 52 const std::string& name, |
| 53 int32_t sample, |
| 54 int32_t min, |
| 55 int32_t max, |
| 56 uint32_t bucket_count); |
| 57 |
| 58 int32_t OnHistogramEnumeration( |
| 59 ppapi::host::HostMessageContext* context, |
| 60 const std::string& name, |
| 61 int32_t sample, |
| 62 int32_t boundary_value); |
| 63 |
| 64 const GURL document_url_; |
| 65 bool is_plugin_in_process_; |
| 66 |
| 67 // Set of origins that can use UMA private APIs from NaCl. |
| 68 std::set<std::string> allowed_origins_; |
| 69 // Set of histograms that can be used from this interface. |
| 70 std::set<std::string> allowed_histograms_; |
| 71 |
| 72 DISALLOW_COPY_AND_ASSIGN(PepperUMAHost); |
| 73 }; |
| 74 |
| 75 #endif // CHROME_RENDERER_PEPPER_PEPPER_UMA_HOST_H_ |
OLD | NEW |