OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifdef _MSC_VER | 5 #ifdef _MSC_VER |
6 // Do not warn about use of std::copy with raw pointers. | 6 // Do not warn about use of std::copy with raw pointers. |
7 #pragma warning(disable : 4996) | 7 #pragma warning(disable : 4996) |
8 #endif | 8 #endif |
9 | 9 |
10 #include "ppapi/native_client/src/trusted/plugin/plugin.h" | 10 #include "ppapi/native_client/src/trusted/plugin/plugin.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 const size_t kNaClManifestMaxFileBytes = 1024 * 1024; | 85 const size_t kNaClManifestMaxFileBytes = 1024 * 1024; |
86 | 86 |
87 // Define an argument name to enable 'dev' interfaces. To make sure it doesn't | 87 // Define an argument name to enable 'dev' interfaces. To make sure it doesn't |
88 // collide with any user-defined HTML attribute, make the first character '@'. | 88 // collide with any user-defined HTML attribute, make the first character '@'. |
89 const char* const kDevAttribute = "@dev"; | 89 const char* const kDevAttribute = "@dev"; |
90 | 90 |
91 // URL schemes that we treat in special ways. | 91 // URL schemes that we treat in special ways. |
92 const char* const kChromeExtensionUriScheme = "chrome-extension"; | 92 const char* const kChromeExtensionUriScheme = "chrome-extension"; |
93 const char* const kDataUriScheme = "data"; | 93 const char* const kDataUriScheme = "data"; |
94 | 94 |
95 // The key used to find the dictionary nexe URLs in the manifest file. | |
96 const char* const kNexesKey = "nexes"; | |
97 | |
98 // Up to 20 seconds | 95 // Up to 20 seconds |
99 const int64_t kTimeSmallMin = 1; // in ms | 96 const int64_t kTimeSmallMin = 1; // in ms |
100 const int64_t kTimeSmallMax = 20000; // in ms | 97 const int64_t kTimeSmallMax = 20000; // in ms |
101 const uint32_t kTimeSmallBuckets = 100; | 98 const uint32_t kTimeSmallBuckets = 100; |
102 | 99 |
103 // Up to 3 minutes, 20 seconds | 100 // Up to 3 minutes, 20 seconds |
104 const int64_t kTimeMediumMin = 10; // in ms | 101 const int64_t kTimeMediumMin = 10; // in ms |
105 const int64_t kTimeMediumMax = 200000; // in ms | 102 const int64_t kTimeMediumMax = 200000; // in ms |
106 const uint32_t kTimeMediumBuckets = 100; | 103 const uint32_t kTimeMediumBuckets = 100; |
107 | 104 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 // HTTP status codes only go up to 5XX, using "6" to indicate an internal | 253 // HTTP status codes only go up to 5XX, using "6" to indicate an internal |
257 // error. | 254 // error. |
258 // Note: installed files may have "0" for a status code. | 255 // Note: installed files may have "0" for a status code. |
259 if (status < 0 || status >= 600) | 256 if (status < 0 || status >= 600) |
260 sample = 6; | 257 sample = 6; |
261 HistogramEnumerate(name, sample, 7, 6); | 258 HistogramEnumerate(name, sample, 7, 6); |
262 } | 259 } |
263 | 260 |
264 } // namespace | 261 } // namespace |
265 | 262 |
266 static int const kAbiHeaderBuffer = 256; // must be at least EI_ABIVERSION + 1 | |
267 | |
268 void Plugin::AddPropertyGet(const nacl::string& prop_name, | 263 void Plugin::AddPropertyGet(const nacl::string& prop_name, |
269 Plugin::PropertyGetter getter) { | 264 Plugin::PropertyGetter getter) { |
270 PLUGIN_PRINTF(("Plugin::AddPropertyGet (prop_name='%s')\n", | 265 PLUGIN_PRINTF(("Plugin::AddPropertyGet (prop_name='%s')\n", |
271 prop_name.c_str())); | 266 prop_name.c_str())); |
272 property_getters_[nacl::string(prop_name)] = getter; | 267 property_getters_[nacl::string(prop_name)] = getter; |
273 } | 268 } |
274 | 269 |
275 bool Plugin::HasProperty(const nacl::string& prop_name) { | 270 bool Plugin::HasProperty(const nacl::string& prop_name) { |
276 PLUGIN_PRINTF(("Plugin::HasProperty (prop_name=%s)\n", | 271 PLUGIN_PRINTF(("Plugin::HasProperty (prop_name=%s)\n", |
277 prop_name.c_str())); | 272 prop_name.c_str())); |
(...skipping 1404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1682 static_cast<uint32_t>(text.size())); | 1677 static_cast<uint32_t>(text.size())); |
1683 const PPB_Console* console_interface = | 1678 const PPB_Console* console_interface = |
1684 static_cast<const PPB_Console*>( | 1679 static_cast<const PPB_Console*>( |
1685 module->GetBrowserInterface(PPB_CONSOLE_INTERFACE)); | 1680 module->GetBrowserInterface(PPB_CONSOLE_INTERFACE)); |
1686 console_interface->LogWithSource(pp_instance(), PP_LOGLEVEL_LOG, prefix, str); | 1681 console_interface->LogWithSource(pp_instance(), PP_LOGLEVEL_LOG, prefix, str); |
1687 var_interface->Release(prefix); | 1682 var_interface->Release(prefix); |
1688 var_interface->Release(str); | 1683 var_interface->Release(str); |
1689 } | 1684 } |
1690 | 1685 |
1691 } // namespace plugin | 1686 } // namespace plugin |
OLD | NEW |