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 #include "ppapi/proxy/flash_resource.h" | 5 #include "ppapi/proxy/flash_resource.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/containers/mru_cache.h" | 9 #include "base/containers/mru_cache.h" |
10 #include "base/debug/crash_logging.h" | |
11 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
12 #include "base/time.h" | 11 #include "base/time.h" |
13 #include "ppapi/c/pp_errors.h" | 12 #include "ppapi/c/pp_errors.h" |
14 #include "ppapi/c/private/ppb_flash.h" | 13 #include "ppapi/c/private/ppb_flash.h" |
15 #include "ppapi/c/trusted/ppb_browser_font_trusted.h" | 14 #include "ppapi/c/trusted/ppb_browser_font_trusted.h" |
16 #include "ppapi/proxy/plugin_dispatcher.h" | 15 #include "ppapi/proxy/plugin_dispatcher.h" |
17 #include "ppapi/proxy/plugin_globals.h" | 16 #include "ppapi/proxy/plugin_globals.h" |
18 #include "ppapi/proxy/ppapi_messages.h" | 17 #include "ppapi/proxy/ppapi_messages.h" |
19 #include "ppapi/proxy/serialized_structs.h" | 18 #include "ppapi/proxy/serialized_structs.h" |
20 #include "ppapi/shared_impl/ppapi_preferences.h" | 19 #include "ppapi/shared_impl/ppapi_preferences.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 return PP_MakeUndefined(); | 76 return PP_MakeUndefined(); |
78 } | 77 } |
79 | 78 |
80 void FlashResource::UpdateActivity(PP_Instance instance) { | 79 void FlashResource::UpdateActivity(PP_Instance instance) { |
81 Post(BROWSER, PpapiHostMsg_Flash_UpdateActivity()); | 80 Post(BROWSER, PpapiHostMsg_Flash_UpdateActivity()); |
82 } | 81 } |
83 | 82 |
84 PP_Bool FlashResource::SetCrashData(PP_Instance instance, | 83 PP_Bool FlashResource::SetCrashData(PP_Instance instance, |
85 PP_FlashCrashKey key, | 84 PP_FlashCrashKey key, |
86 PP_Var value) { | 85 PP_Var value) { |
87 StringVar* url_string_var(StringVar::FromPPVar(value)); | |
88 if (!url_string_var) | |
89 return PP_FALSE; | |
90 switch (key) { | 86 switch (key) { |
91 case PP_FLASHCRASHKEY_URL: { | 87 case PP_FLASHCRASHKEY_URL: { |
| 88 StringVar* url_string_var(StringVar::FromPPVar(value)); |
| 89 if (!url_string_var) |
| 90 return PP_FALSE; |
92 PluginGlobals::Get()->SetActiveURL(url_string_var->value()); | 91 PluginGlobals::Get()->SetActiveURL(url_string_var->value()); |
93 return PP_TRUE; | 92 return PP_TRUE; |
94 } | 93 } |
95 case PP_FLASHCRASHKEY_RESOURCE_URL: { | |
96 base::debug::SetCrashKeyValue("subresource_url", url_string_var->value()); | |
97 return PP_TRUE; | |
98 } | |
99 } | 94 } |
100 return PP_FALSE; | 95 return PP_FALSE; |
101 } | 96 } |
102 | 97 |
103 double FlashResource::GetLocalTimeZoneOffset(PP_Instance instance, | 98 double FlashResource::GetLocalTimeZoneOffset(PP_Instance instance, |
104 PP_Time t) { | 99 PP_Time t) { |
105 LocalTimeZoneOffsetCache& cache = g_local_time_zone_offset_cache.Get(); | 100 LocalTimeZoneOffsetCache& cache = g_local_time_zone_offset_cache.Get(); |
106 | 101 |
107 // Get the minimum PP_Time value that shares the same minute as |t|. | 102 // Get the minimum PP_Time value that shares the same minute as |t|. |
108 // Use cached offset if cache hasn't expired and |t| is in the same minute as | 103 // Use cached offset if cache hasn't expired and |t| is in the same minute as |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 PpapiHostMsg_Flash_IsRectTopmost(*rect)); | 242 PpapiHostMsg_Flash_IsRectTopmost(*rect)); |
248 return PP_FromBool(result == PP_OK); | 243 return PP_FromBool(result == PP_OK); |
249 } | 244 } |
250 | 245 |
251 void FlashResource::InvokePrinting(PP_Instance instance) { | 246 void FlashResource::InvokePrinting(PP_Instance instance) { |
252 Post(RENDERER, PpapiHostMsg_Flash_InvokePrinting()); | 247 Post(RENDERER, PpapiHostMsg_Flash_InvokePrinting()); |
253 } | 248 } |
254 | 249 |
255 } // namespace proxy | 250 } // namespace proxy |
256 } // namespace ppapi | 251 } // namespace ppapi |
OLD | NEW |