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

Unified Diff: gpu/gpu_plugin/gpu_plugin.cc

Issue 465040: Added CommandBufferClient, CommandBufferStub and some IPC messages.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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
« no previous file with comments | « gpu/gpu_plugin/gpu_plugin.h ('k') | gpu/gpu_plugin/gpu_plugin_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/gpu_plugin/gpu_plugin.cc
===================================================================
--- gpu/gpu_plugin/gpu_plugin.cc (revision 34314)
+++ gpu/gpu_plugin/gpu_plugin.cc (working copy)
@@ -1,25 +1,15 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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 "gpu/gpu_plugin/gpu_plugin.h"
-#include "gpu/gpu_plugin/gpu_plugin_object_factory.h"
-#include "gpu/np_utils/np_browser.h"
-#include "gpu/np_utils/np_plugin_object.h"
-#include "gpu/np_utils/np_plugin_object_factory.h"
#include "webkit/glue/plugins/nphostapi.h"
-using np_utils::NPBrowser;
-using np_utils::NPPluginObjectFactory;
-using np_utils::PluginObject;
-
namespace gpu_plugin {
// Definitions of NPAPI plugin entry points.
namespace {
-NPBrowser* g_browser;
-GPUPluginObjectFactory g_plugin_object_factory;
NPError NPP_New(NPMIMEType plugin_type, NPP instance,
uint16 mode, int16 argc, char* argn[],
@@ -27,64 +17,29 @@
if (!instance)
return NPERR_INVALID_INSTANCE_ERROR;
- PluginObject* plugin_object =
- NPPluginObjectFactory::get()->CreatePluginObject(instance, plugin_type);
- if (!plugin_object)
- return NPERR_GENERIC_ERROR;
-
- instance->pdata = plugin_object;
-
- NPError error = plugin_object->New(plugin_type, argc, argn, argv, saved);
- if (error != NPERR_NO_ERROR) {
- plugin_object->Release();
- }
-
- return error;
+ return NPERR_NO_ERROR;
}
NPError NPP_Destroy(NPP instance, NPSavedData** saved) {
if (!instance)
return NPERR_INVALID_INSTANCE_ERROR;
- PluginObject* plugin_object = static_cast<PluginObject*>(instance->pdata);
- NPError error = plugin_object->Destroy(saved);
-
- if (error == NPERR_NO_ERROR) {
- plugin_object->Release();
- }
-
- return error;
+ return NPERR_NO_ERROR;
}
NPError NPP_SetWindow(NPP instance, NPWindow* window) {
- if (!instance)
- return NPERR_INVALID_INSTANCE_ERROR;
-
- PluginObject* plugin_object = static_cast<PluginObject*>(instance->pdata);
- return plugin_object->SetWindow(window);
+ return NPERR_NO_ERROR;
}
int16 NPP_HandleEvent(NPP instance, void* event) {
- if (!instance)
- return 0;
-
- PluginObject* plugin_object = static_cast<PluginObject*>(instance->pdata);
- return plugin_object->HandleEvent(static_cast<NPEvent*>(event));
+ return 0;
}
NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value) {
if (!instance)
return NPERR_INVALID_INSTANCE_ERROR;
- PluginObject* plugin_object = static_cast<PluginObject*>(instance->pdata);
- switch (variable) {
- case NPPVpluginScriptableNPObject:
- *reinterpret_cast<NPObject**>(value) =
- plugin_object->GetScriptableNPObject();
- return NPERR_NO_ERROR;
- default:
- return NPERR_GENERIC_ERROR;
- }
+ return NPERR_GENERIC_ERROR;
}
NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value) {
@@ -111,25 +66,14 @@
if (!browser_funcs)
return NPERR_INVALID_FUNCTABLE_ERROR;
- if (g_browser)
- return NPERR_GENERIC_ERROR;
-
#if defined(OS_LINUX)
NP_GetEntryPoints(plugin_funcs);
#endif
- g_browser = new NPBrowser(browser_funcs);
-
return NPERR_NO_ERROR;
}
NPError NP_Shutdown() {
- if (!g_browser)
- return NPERR_GENERIC_ERROR;
-
- delete g_browser;
- g_browser = NULL;
-
return NPERR_NO_ERROR;
}
} // namespace gpu_plugin
« no previous file with comments | « gpu/gpu_plugin/gpu_plugin.h ('k') | gpu/gpu_plugin/gpu_plugin_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698