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

Unified Diff: content/renderer/pepper/pepper_instance_state_accessor_impl.cc

Issue 10815073: Refactoring of new IPC-only pepper implementation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months 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/renderer/pepper/pepper_instance_state_accessor_impl.cc
diff --git a/content/renderer/pepper/pepper_instance_state_accessor_impl.cc b/content/renderer/pepper/pepper_instance_state_accessor_impl.cc
deleted file mode 100644
index 376d3aa89af5c54d8d7683db19ce591769e082fc..0000000000000000000000000000000000000000
--- a/content/renderer/pepper/pepper_instance_state_accessor_impl.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/renderer/pepper/pepper_instance_state_accessor_impl.h"
-
-#include "ppapi/shared_impl/ppapi_permissions.h"
-#include "webkit/plugins/ppapi/host_globals.h"
-#include "webkit/plugins/ppapi/plugin_module.h"
-#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
-
-using webkit::ppapi::HostGlobals;
-using webkit::ppapi::PluginInstance;
-
-namespace content {
-
-PepperInstanceStateAccessorImpl::PepperInstanceStateAccessorImpl(
- webkit::ppapi::PluginModule* module)
- : module_(module) {
-}
-
-PepperInstanceStateAccessorImpl::~PepperInstanceStateAccessorImpl() {
-}
-
-bool PepperInstanceStateAccessorImpl::IsValidInstance(PP_Instance instance) {
- return !!GetAndValidateInstance(instance);
-}
-
-bool PepperInstanceStateAccessorImpl::HasUserGesture(PP_Instance pp_instance) {
- PluginInstance* instance = GetAndValidateInstance(pp_instance);
- if (!instance)
- return false;
-
- if (instance->module()->permissions().HasPermission(
- ppapi::PERMISSION_BYPASS_USER_GESTURE))
- return true;
- return instance->IsProcessingUserGesture();
-}
-
-PluginInstance* PepperInstanceStateAccessorImpl::GetAndValidateInstance(
- PP_Instance pp_instance) {
- PluginInstance* instance = HostGlobals::Get()->GetInstance(pp_instance);
- if (!instance)
- return NULL;
- if (instance->module() != module_)
- return NULL;
- return instance;
-}
-
-} // namespace content
« no previous file with comments | « content/renderer/pepper/pepper_instance_state_accessor_impl.h ('k') | content/renderer/pepper/pepper_plugin_delegate_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698