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

Side by Side Diff: webkit/plugins/ppapi/ppb_flash_clipboard_impl.cc

Issue 7621054: Don't use a scoped_refptr for StringVar::FromPPVar (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "webkit/plugins/ppapi/ppb_flash_clipboard_impl.h" 5 #include "webkit/plugins/ppapi/ppb_flash_clipboard_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 } 92 }
93 93
94 WebKit::WebCString s = 94 WebKit::WebCString s =
95 web_clipboard->readPlainText(ConvertClipboardType(clipboard_type)).utf8(); 95 web_clipboard->readPlainText(ConvertClipboardType(clipboard_type)).utf8();
96 return StringVar::StringToPPVar(instance->module()->pp_module(), s); 96 return StringVar::StringToPPVar(instance->module()->pp_module(), s);
97 } 97 }
98 98
99 int32_t WritePlainText(PP_Instance instance_id, 99 int32_t WritePlainText(PP_Instance instance_id,
100 PP_Flash_Clipboard_Type clipboard_type, 100 PP_Flash_Clipboard_Type clipboard_type,
101 PP_Var text) { 101 PP_Var text) {
102 scoped_refptr<StringVar> text_string(StringVar::FromPPVar(text)); 102 StringVar* text_string = StringVar::FromPPVar(text);
103 if (!text_string) 103 if (!text_string)
104 return PP_ERROR_BADARGUMENT; 104 return PP_ERROR_BADARGUMENT;
105 105
106 if (text_string->value().length() > kMaxClipboardWriteSize) 106 if (text_string->value().length() > kMaxClipboardWriteSize)
107 return PP_ERROR_NOSPACE; 107 return PP_ERROR_NOSPACE;
108 108
109 if (clipboard_type != PP_FLASH_CLIPBOARD_TYPE_STANDARD) { 109 if (clipboard_type != PP_FLASH_CLIPBOARD_TYPE_STANDARD) {
110 NOTIMPLEMENTED(); 110 NOTIMPLEMENTED();
111 return PP_ERROR_FAILED; 111 return PP_ERROR_FAILED;
112 } 112 }
(...skipping 18 matching lines...) Expand all
131 } // namespace 131 } // namespace
132 132
133 // static 133 // static
134 const PPB_Flash_Clipboard* 134 const PPB_Flash_Clipboard*
135 PPB_Flash_Clipboard_Impl::GetInterface() { 135 PPB_Flash_Clipboard_Impl::GetInterface() {
136 return &ppb_flash_clipboard; 136 return &ppb_flash_clipboard;
137 } 137 }
138 138
139 } // namespace ppapi 139 } // namespace ppapi
140 } // namespace webkit 140 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/ppapi_plugin_instance.cc ('k') | webkit/plugins/ppapi/ppb_flash_impl_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698