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

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 2599713002: Use explicit WebString <-> string{16,} conversion methods in content/renderer/pepper (Closed)
Patch Set: . Created 3 years, 12 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
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/pepper/pepper_plugin_instance_impl.h" 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bit_cast.h" 10 #include "base/bit_cast.h"
(...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after
1449 void PepperPluginInstanceImpl::RequestSurroundingText( 1449 void PepperPluginInstanceImpl::RequestSurroundingText(
1450 size_t desired_number_of_characters) { 1450 size_t desired_number_of_characters) {
1451 // Keep a reference on the stack. See NOTE above. 1451 // Keep a reference on the stack. See NOTE above.
1452 scoped_refptr<PepperPluginInstanceImpl> ref(this); 1452 scoped_refptr<PepperPluginInstanceImpl> ref(this);
1453 if (!LoadTextInputInterface()) 1453 if (!LoadTextInputInterface())
1454 return; 1454 return;
1455 plugin_textinput_interface_->RequestSurroundingText( 1455 plugin_textinput_interface_->RequestSurroundingText(
1456 pp_instance(), desired_number_of_characters); 1456 pp_instance(), desired_number_of_characters);
1457 } 1457 }
1458 1458
1459 bool PepperPluginInstanceImpl::StartFind(const base::string16& search_text, 1459 bool PepperPluginInstanceImpl::StartFind(const std::string& search_text,
1460 bool case_sensitive, 1460 bool case_sensitive,
1461 int identifier) { 1461 int identifier) {
1462 // Keep a reference on the stack. See NOTE above. 1462 // Keep a reference on the stack. See NOTE above.
1463 scoped_refptr<PepperPluginInstanceImpl> ref(this); 1463 scoped_refptr<PepperPluginInstanceImpl> ref(this);
1464 if (!LoadFindInterface()) 1464 if (!LoadFindInterface())
1465 return false; 1465 return false;
1466 find_identifier_ = identifier; 1466 find_identifier_ = identifier;
1467 return PP_ToBool( 1467 return PP_ToBool(plugin_find_interface_->StartFind(
1468 plugin_find_interface_->StartFind(pp_instance(), 1468 pp_instance(), search_text.c_str(), PP_FromBool(case_sensitive)));
1469 base::UTF16ToUTF8(search_text).c_str(),
1470 PP_FromBool(case_sensitive)));
1471 } 1469 }
1472 1470
1473 void PepperPluginInstanceImpl::SelectFindResult(bool forward, int identifier) { 1471 void PepperPluginInstanceImpl::SelectFindResult(bool forward, int identifier) {
1474 // Keep a reference on the stack. See NOTE above. 1472 // Keep a reference on the stack. See NOTE above.
1475 scoped_refptr<PepperPluginInstanceImpl> ref(this); 1473 scoped_refptr<PepperPluginInstanceImpl> ref(this);
1476 if (!LoadFindInterface()) 1474 if (!LoadFindInterface())
1477 return; 1475 return;
1478 find_identifier_ = identifier; 1476 find_identifier_ = identifier;
1479 plugin_find_interface_->SelectFindResult(pp_instance(), PP_FromBool(forward)); 1477 plugin_find_interface_->SelectFindResult(pp_instance(), PP_FromBool(forward));
1480 } 1478 }
(...skipping 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after
3456 const cc::TextureMailbox& mailbox) const { 3454 const cc::TextureMailbox& mailbox) const {
3457 auto it = 3455 auto it =
3458 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(), 3456 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(),
3459 [&mailbox](const TextureMailboxRefCount& ref_count) { 3457 [&mailbox](const TextureMailboxRefCount& ref_count) {
3460 return ref_count.first.mailbox() == mailbox.mailbox(); 3458 return ref_count.first.mailbox() == mailbox.mailbox();
3461 }); 3459 });
3462 return it != texture_ref_counts_.end(); 3460 return it != texture_ref_counts_.end();
3463 } 3461 }
3464 3462
3465 } // namespace content 3463 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698