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

Side by Side Diff: content/plugin/plugin_channel.cc

Issue 19761007: Move NPAPI implementation out of webkit/plugins/npapi and into content. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "content/plugin/plugin_channel.h" 5 #include "content/plugin/plugin_channel.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
11 #include "base/synchronization/lock.h" 11 #include "base/synchronization/lock.h"
12 #include "base/synchronization/waitable_event.h" 12 #include "base/synchronization/waitable_event.h"
13 #include "build/build_config.h" 13 #include "build/build_config.h"
14 #include "content/child/child_process.h" 14 #include "content/child/child_process.h"
15 #include "content/child/npapi/plugin_instance.h"
15 #include "content/child/plugin_messages.h" 16 #include "content/child/plugin_messages.h"
16 #include "content/common/plugin_process_messages.h" 17 #include "content/common/plugin_process_messages.h"
17 #include "content/plugin/plugin_thread.h" 18 #include "content/plugin/plugin_thread.h"
18 #include "content/plugin/webplugin_delegate_stub.h" 19 #include "content/plugin/webplugin_delegate_stub.h"
19 #include "content/plugin/webplugin_proxy.h" 20 #include "content/plugin/webplugin_proxy.h"
20 #include "content/public/common/content_switches.h" 21 #include "content/public/common/content_switches.h"
21 #include "third_party/WebKit/public/web/WebBindings.h" 22 #include "third_party/WebKit/public/web/WebBindings.h"
22 #include "webkit/plugins/npapi/plugin_instance.h"
23 23
24 #if defined(OS_POSIX) 24 #if defined(OS_POSIX)
25 #include "base/posix/eintr_wrapper.h" 25 #include "base/posix/eintr_wrapper.h"
26 #include "ipc/ipc_channel_posix.h" 26 #include "ipc/ipc_channel_posix.h"
27 #endif 27 #endif
28 28
29 using WebKit::WebBindings; 29 using WebKit::WebBindings;
30 30
31 namespace content { 31 namespace content {
32 32
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 void PluginChannel::OnGenerateRouteID(int* route_id) { 305 void PluginChannel::OnGenerateRouteID(int* route_id) {
306 *route_id = GenerateRouteID(); 306 *route_id = GenerateRouteID();
307 } 307 }
308 308
309 void PluginChannel::OnClearSiteData(const std::string& site, 309 void PluginChannel::OnClearSiteData(const std::string& site,
310 uint64 flags, 310 uint64 flags,
311 uint64 max_age) { 311 uint64 max_age) {
312 bool success = false; 312 bool success = false;
313 CommandLine* command_line = CommandLine::ForCurrentProcess(); 313 CommandLine* command_line = CommandLine::ForCurrentProcess();
314 base::FilePath path = command_line->GetSwitchValuePath(switches::kPluginPath); 314 base::FilePath path = command_line->GetSwitchValuePath(switches::kPluginPath);
315 scoped_refptr<webkit::npapi::PluginLib> plugin_lib( 315 scoped_refptr<PluginLib> plugin_lib(PluginLib::CreatePluginLib(path));
316 webkit::npapi::PluginLib::CreatePluginLib(path));
317 if (plugin_lib.get()) { 316 if (plugin_lib.get()) {
318 NPError err = plugin_lib->NP_Initialize(); 317 NPError err = plugin_lib->NP_Initialize();
319 if (err == NPERR_NO_ERROR) { 318 if (err == NPERR_NO_ERROR) {
320 const char* site_str = site.empty() ? NULL : site.c_str(); 319 const char* site_str = site.empty() ? NULL : site.c_str();
321 err = plugin_lib->NP_ClearSiteData(site_str, flags, max_age); 320 err = plugin_lib->NP_ClearSiteData(site_str, flags, max_age);
322 std::string site_name = 321 std::string site_name =
323 site.empty() ? "NULL" 322 site.empty() ? "NULL"
324 : base::StringPrintf("\"%s\"", site_str); 323 : base::StringPrintf("\"%s\"", site_str);
325 VLOG(1) << "NPP_ClearSiteData(" << site_name << ", " << flags << ", " 324 VLOG(1) << "NPP_ClearSiteData(" << site_name << ", " << flags << ", "
326 << max_age << ") returned " << err; 325 << max_age << ") returned " << err;
327 success = (err == NPERR_NO_ERROR); 326 success = (err == NPERR_NO_ERROR);
328 } 327 }
329 } 328 }
330 Send(new PluginProcessHostMsg_ClearSiteDataResult(success)); 329 Send(new PluginProcessHostMsg_ClearSiteDataResult(success));
331 } 330 }
332 331
333 } // namespace content 332 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698