mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
cefclient:
- Add tests for CefBrowser::GetText() and CefBrowser::GetSource(). - Do not execute calls to CefBrowser::GetText() and CefBrowser::GetSource() on the main application UI thread when running in multi-threaded message loop mode because those calls will block resulting in potential deadlock (issue #79). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@76 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2009 The Chromium Embedded Framework Authors. All rights
|
||||
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
|
||||
@ -81,3 +81,20 @@ void DumpRequestContents(CefRefPtr<CefRequest> request, std::wstring& str)
|
||||
|
||||
str = ss.str();
|
||||
}
|
||||
|
||||
std::wstring StringReplace(const std::wstring& str, const std::wstring& from,
|
||||
const std::wstring& to)
|
||||
{
|
||||
std::wstring result = str;
|
||||
std::wstring::size_type pos = 0;
|
||||
std::wstring::size_type from_len = from.length();
|
||||
std::wstring::size_type to_len = to.length();
|
||||
do {
|
||||
pos = result.find(from, pos);
|
||||
if(pos != std::wstring::npos) {
|
||||
result.replace(pos, from_len, to);
|
||||
pos += to_len;
|
||||
}
|
||||
} while(pos != std::wstring::npos);
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user