OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/plugins/ppapi/ppb_flash_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_flash_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
11 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
12 #include "ppapi/c/private/ppb_flash.h" | 12 #include "ppapi/c/private/ppb_flash.h" |
13 #include "ppapi/thunk/enter.h" | 13 #include "ppapi/thunk/enter.h" |
14 #include "webkit/plugins/ppapi/common.h" | 14 #include "webkit/plugins/ppapi/common.h" |
15 #include "webkit/plugins/ppapi/plugin_delegate.h" | 15 #include "webkit/plugins/ppapi/plugin_delegate.h" |
16 #include "webkit/plugins/ppapi/plugin_module.h" | 16 #include "webkit/plugins/ppapi/plugin_module.h" |
17 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 17 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
18 #include "webkit/plugins/ppapi/ppb_url_request_info_impl.h" | 18 #include "webkit/plugins/ppapi/ppb_url_request_info_impl.h" |
19 #include "webkit/plugins/ppapi/resource_tracker.h" | 19 #include "webkit/plugins/ppapi/resource_tracker.h" |
| 20 #include "webkit/plugins/ppapi/time_conversion.h" |
20 #include "webkit/plugins/ppapi/var.h" | 21 #include "webkit/plugins/ppapi/var.h" |
21 | 22 |
22 using ppapi::thunk::EnterResource; | 23 using ppapi::thunk::EnterResource; |
23 using ppapi::thunk::PPB_URLRequestInfo_API; | 24 using ppapi::thunk::PPB_URLRequestInfo_API; |
24 | 25 |
25 namespace webkit { | 26 namespace webkit { |
26 namespace ppapi { | 27 namespace ppapi { |
27 | 28 |
28 namespace { | 29 namespace { |
29 | 30 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // a "null" Time object. This will represent some date hundreds of years ago | 89 // a "null" Time object. This will represent some date hundreds of years ago |
89 // and will give us funny results at 1970 (there are some tests where this | 90 // and will give us funny results at 1970 (there are some tests where this |
90 // comes up, but it shouldn't happen in real life). To work around this | 91 // comes up, but it shouldn't happen in real life). To work around this |
91 // special handling, we just need to give it some nonzero value. | 92 // special handling, we just need to give it some nonzero value. |
92 if (t == 0.0) | 93 if (t == 0.0) |
93 t = 0.0000000001; | 94 t = 0.0000000001; |
94 | 95 |
95 // We can't do the conversion here because on Linux, the localtime calls | 96 // We can't do the conversion here because on Linux, the localtime calls |
96 // require filesystem access prohibited by the sandbox. | 97 // require filesystem access prohibited by the sandbox. |
97 return instance->delegate()->GetLocalTimeZoneOffset( | 98 return instance->delegate()->GetLocalTimeZoneOffset( |
98 base::Time::FromDoubleT(t)); | 99 PPTimeToTime(t)); |
99 } | 100 } |
100 | 101 |
101 PP_Var GetCommandLineArgs(PP_Module pp_module) { | 102 PP_Var GetCommandLineArgs(PP_Module pp_module) { |
102 PluginModule* module = ResourceTracker::Get()->GetModule(pp_module); | 103 PluginModule* module = ResourceTracker::Get()->GetModule(pp_module); |
103 if (!module) | 104 if (!module) |
104 return PP_MakeUndefined(); | 105 return PP_MakeUndefined(); |
105 | 106 |
106 PluginInstance* instance = module->GetSomeInstance(); | 107 PluginInstance* instance = module->GetSomeInstance(); |
107 if (!instance) | 108 if (!instance) |
108 return PP_MakeUndefined(); | 109 return PP_MakeUndefined(); |
(...skipping 15 matching lines...) Expand all Loading... |
124 | 125 |
125 } // namespace | 126 } // namespace |
126 | 127 |
127 // static | 128 // static |
128 const PPB_Flash* PPB_Flash_Impl::GetInterface() { | 129 const PPB_Flash* PPB_Flash_Impl::GetInterface() { |
129 return &ppb_flash; | 130 return &ppb_flash; |
130 } | 131 } |
131 | 132 |
132 } // namespace ppapi | 133 } // namespace ppapi |
133 } // namespace webkit | 134 } // namespace webkit |
OLD | NEW |