Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: content/browser/renderer_host/pepper/pepper_flash_browser_host.cc

Issue 11516020: Refactor PPB_Flash GetLocalTimeZoneOffset to the new PPAPI resource model (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/pepper/pepper_flash_browser_host.cc
diff --git a/content/browser/renderer_host/pepper/pepper_flash_browser_host.cc b/content/browser/renderer_host/pepper/pepper_flash_browser_host.cc
index ba4f75f6e4946d9e231f1a2112360f9a89639d98..c27dfb03d6074e34e24319993ee560147d82332e 100644
--- a/content/browser/renderer_host/pepper/pepper_flash_browser_host.cc
+++ b/content/browser/renderer_host/pepper/pepper_flash_browser_host.cc
@@ -4,12 +4,14 @@
#include "content/browser/renderer_host/pepper/pepper_flash_browser_host.h"
+#include "base/time.h"
#include "content/public/browser/browser_ppapi_host.h"
#include "ipc/ipc_message_macros.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/host/dispatch_host_message.h"
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/proxy/resource_message_params.h"
+#include "ppapi/shared_impl/time_conversion.h"
#ifdef OS_WIN
#include <windows.h>
@@ -35,6 +37,8 @@ int32_t PepperFlashBrowserHost::OnResourceMessageReceived(
IPC_BEGIN_MESSAGE_MAP(PepperFlashBrowserHost, msg)
PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_Flash_UpdateActivity,
OnMsgUpdateActivity);
+ PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Flash_GetLocalTimeZoneOffset,
+ OnMsgGetLocalTimeZoneOffset);
IPC_END_MESSAGE_MAP()
return PP_ERROR_FAILED;
}
@@ -57,4 +61,15 @@ int32_t PepperFlashBrowserHost::OnMsgUpdateActivity(
return PP_OK;
}
+int32_t PepperFlashBrowserHost::OnMsgGetLocalTimeZoneOffset(
+ ppapi::host::HostMessageContext* host_context,
+ const base::Time& t) {
+ // The reason for this processing being in the browser process is that on
+ // Linux, the localtime calls require filesystem access prohibited by the
+ // sandbox.
+ host_context->reply_msg = PpapiPluginMsg_Flash_GetLocalTimeZoneOffsetReply(
+ ppapi::PPGetLocalTimeZoneOffset(t));
+ return PP_OK;
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698