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

Side by Side Diff: content/renderer/browser_plugin/browser_plugin_bindings.cc

Issue 10977073: Delete some unused code found by -Wunused-function (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: leiz Created 8 years, 2 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
« no previous file with comments | « content/gpu/gpu_main.cc ('k') | content/renderer/pepper/pepper_url_request_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/renderer/browser_plugin/browser_plugin_bindings.h" 5 #include "content/renderer/browser_plugin/browser_plugin_bindings.h"
6 6
7 #include <cstdlib> 7 #include <cstdlib>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 return WebBindings::getStringIdentifier(kPartitionAttribute) == identifier; 79 return WebBindings::getStringIdentifier(kPartitionAttribute) == identifier;
80 } 80 }
81 81
82 std::string StringFromNPVariant(const NPVariant& variant) { 82 std::string StringFromNPVariant(const NPVariant& variant) {
83 if (!NPVARIANT_IS_STRING(variant)) 83 if (!NPVARIANT_IS_STRING(variant))
84 return std::string(); 84 return std::string();
85 const NPString& np_string = NPVARIANT_TO_STRING(variant); 85 const NPString& np_string = NPVARIANT_TO_STRING(variant);
86 return std::string(np_string.UTF8Characters, np_string.UTF8Length); 86 return std::string(np_string.UTF8Characters, np_string.UTF8Length);
87 } 87 }
88 88
89 string16 String16FromNPVariant(const NPVariant& variant) {
90 if (!NPVARIANT_IS_STRING(variant))
91 return string16();
92 const NPString& np_string = NPVARIANT_TO_STRING(variant);
93 string16 wstr;
94 if (!UTF8ToUTF16(np_string.UTF8Characters, np_string.UTF8Length, &wstr))
95 return string16();
96 return wstr;
97 }
98
99 bool StringToNPVariant(const std::string &in, NPVariant *variant) { 89 bool StringToNPVariant(const std::string &in, NPVariant *variant) {
100 size_t length = in.size(); 90 size_t length = in.size();
101 NPUTF8 *chars = static_cast<NPUTF8 *>(malloc(length)); 91 NPUTF8 *chars = static_cast<NPUTF8 *>(malloc(length));
102 if (!chars) { 92 if (!chars) {
103 VOID_TO_NPVARIANT(*variant); 93 VOID_TO_NPVARIANT(*variant);
104 return false; 94 return false;
105 } 95 }
106 memcpy(chars, in.c_str(), length); 96 memcpy(chars, in.c_str(), length);
107 STRINGN_TO_NPVARIANT(chars, length, *variant); 97 STRINGN_TO_NPVARIANT(chars, length, *variant);
108 return true; 98 return true;
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 WebBindings::createObject(NULL, &browser_plugin_message_class); 310 WebBindings::createObject(NULL, &browser_plugin_message_class);
321 np_object_ = static_cast<BrowserPluginBindings::BrowserPluginNPObject*>(obj); 311 np_object_ = static_cast<BrowserPluginBindings::BrowserPluginNPObject*>(obj);
322 np_object_->message_channel = weak_ptr_factory_.GetWeakPtr(); 312 np_object_->message_channel = weak_ptr_factory_.GetWeakPtr();
323 } 313 }
324 314
325 BrowserPluginBindings::~BrowserPluginBindings() { 315 BrowserPluginBindings::~BrowserPluginBindings() {
326 WebBindings::releaseObject(np_object_); 316 WebBindings::releaseObject(np_object_);
327 } 317 }
328 318
329 } // namespace content 319 } // namespace content
OLDNEW
« no previous file with comments | « content/gpu/gpu_main.cc ('k') | content/renderer/pepper/pepper_url_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698