| 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 "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/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 290 |
| 291 void PluginChannel::OnGenerateRouteID(int* route_id) { | 291 void PluginChannel::OnGenerateRouteID(int* route_id) { |
| 292 *route_id = GenerateRouteID(); | 292 *route_id = GenerateRouteID(); |
| 293 } | 293 } |
| 294 | 294 |
| 295 void PluginChannel::OnClearSiteData(const std::string& site, | 295 void PluginChannel::OnClearSiteData(const std::string& site, |
| 296 uint64 flags, | 296 uint64 flags, |
| 297 uint64 max_age) { | 297 uint64 max_age) { |
| 298 bool success = false; | 298 bool success = false; |
| 299 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 299 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 300 FilePath path = command_line->GetSwitchValuePath(switches::kPluginPath); | 300 base::FilePath path = command_line->GetSwitchValuePath(switches::kPluginPath); |
| 301 scoped_refptr<webkit::npapi::PluginLib> plugin_lib( | 301 scoped_refptr<webkit::npapi::PluginLib> plugin_lib( |
| 302 webkit::npapi::PluginLib::CreatePluginLib(path)); | 302 webkit::npapi::PluginLib::CreatePluginLib(path)); |
| 303 if (plugin_lib.get()) { | 303 if (plugin_lib.get()) { |
| 304 NPError err = plugin_lib->NP_Initialize(); | 304 NPError err = plugin_lib->NP_Initialize(); |
| 305 if (err == NPERR_NO_ERROR) { | 305 if (err == NPERR_NO_ERROR) { |
| 306 const char* site_str = site.empty() ? NULL : site.c_str(); | 306 const char* site_str = site.empty() ? NULL : site.c_str(); |
| 307 err = plugin_lib->NP_ClearSiteData(site_str, flags, max_age); | 307 err = plugin_lib->NP_ClearSiteData(site_str, flags, max_age); |
| 308 std::string site_name = | 308 std::string site_name = |
| 309 site.empty() ? "NULL" | 309 site.empty() ? "NULL" |
| 310 : base::StringPrintf("\"%s\"", site_str); | 310 : base::StringPrintf("\"%s\"", site_str); |
| 311 VLOG(1) << "NPP_ClearSiteData(" << site_name << ", " << flags << ", " | 311 VLOG(1) << "NPP_ClearSiteData(" << site_name << ", " << flags << ", " |
| 312 << max_age << ") returned " << err; | 312 << max_age << ") returned " << err; |
| 313 success = (err == NPERR_NO_ERROR); | 313 success = (err == NPERR_NO_ERROR); |
| 314 } | 314 } |
| 315 } | 315 } |
| 316 Send(new PluginHostMsg_ClearSiteDataResult(success)); | 316 Send(new PluginHostMsg_ClearSiteDataResult(success)); |
| 317 } | 317 } |
| 318 | 318 |
| 319 } // namespace content | 319 } // namespace content |
| OLD | NEW |