Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 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_RENDERER_HOST_H_ | |
| 6 #define CHROME_RENDERER_PEPPER_PEPPER_UMA_RENDERER_HOST_H_ | |
| 7 | |
| 8 #include <set> | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/files/file_path.h" | |
|
yzshen1
2013/12/04 19:32:51
no need to have this one, right?
elijahtaylor1
2013/12/21 02:26:21
Done.
| |
| 12 #include "ppapi/c/pp_instance.h" | |
| 13 #include "ppapi/c/pp_resource.h" | |
| 14 #include "ppapi/host/resource_host.h" | |
| 15 #include "ppapi/host/resource_message_filter.h" | |
|
yzshen1
2013/12/04 19:32:51
we don't need this one, right?
elijahtaylor1
2013/12/21 02:26:21
Done.
| |
| 16 #include "url/gurl.h" | |
| 17 | |
| 18 namespace content { | |
| 19 class RendererPpapiHost; | |
| 20 } | |
| 21 | |
| 22 namespace ppapi { | |
| 23 namespace host { | |
| 24 struct HostMessageContext; | |
| 25 } // namespace host | |
| 26 } // namespace ppapi | |
| 27 | |
| 28 class PepperUMARendererHost : public ppapi::host::ResourceHost { | |
| 29 public: | |
| 30 PepperUMARendererHost(content::RendererPpapiHost* host, PP_Instance instance, | |
|
yzshen1
2013/12/04 19:32:51
one parameter on each line, please (this is requir
elijahtaylor1
2013/12/21 02:26:21
Done.
| |
| 31 PP_Resource resource); | |
| 32 | |
|
yzshen1
2013/12/04 19:32:51
redundant line.
elijahtaylor1
2013/12/21 02:26:21
Done.
| |
| 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 virtual ~PepperUMARendererHost(); | |
|
yzshen1
2013/12/04 19:32:51
It seems we don't have to make it a private method
elijahtaylor1
2013/12/21 02:26:21
Done.
| |
| 41 | |
| 42 bool IsHistogramAllowed(const std::string& histogram); | |
| 43 | |
| 44 int32_t OnHistogramCustomTimes( | |
| 45 ppapi::host::HostMessageContext* context, | |
| 46 const std::string& name, | |
| 47 int64_t sample, | |
| 48 int64_t min, | |
| 49 int64_t max, | |
| 50 uint32_t bucket_count); | |
| 51 | |
| 52 int32_t OnHistogramCustomCounts( | |
| 53 ppapi::host::HostMessageContext* context, | |
| 54 const std::string& name, | |
| 55 int32_t sample, | |
| 56 int32_t min, | |
| 57 int32_t max, | |
| 58 uint32_t bucket_count); | |
| 59 | |
| 60 int32_t OnHistogramEnumeration( | |
| 61 ppapi::host::HostMessageContext* context, | |
| 62 const std::string& name, | |
| 63 int32_t sample, | |
| 64 int32_t boundary_value); | |
| 65 | |
| 66 const GURL document_url_; | |
| 67 bool is_plugin_in_process_; | |
| 68 | |
| 69 // Set of origins that can use UMA private APIs from NaCl. | |
| 70 std::set<std::string> allowed_origins_; | |
| 71 // Set of histograms that can be used from this interface. | |
| 72 std::set<std::string> allowed_histograms_; | |
| 73 | |
| 74 DISALLOW_COPY_AND_ASSIGN(PepperUMARendererHost); | |
| 75 }; | |
| 76 | |
| 77 #endif // CHROME_RENDERER_PEPPER_PEPPER_UMA_RENDERER_HOST_H_ | |
| OLD | NEW |