Clear the input array passed to CefBrowser::GetFrameIdentifiers so that the correct values are returned via the C/C++ wrapper API, and add a test (issue #626).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@665 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-06-04 17:03:31 +00:00
parent 0bfea3e1b1
commit 06bc30a802
2 changed files with 36 additions and 4 deletions

View File

@ -434,6 +434,9 @@ size_t CefBrowserHostImpl::GetFrameCount() {
void CefBrowserHostImpl::GetFrameIdentifiers(std::vector<int64>& identifiers) {
base::AutoLock lock_scope(state_lock_);
if (identifiers.size() > 0)
identifiers.clear();
FrameMap::const_iterator it = frames_.begin();
for (; it != frames_.end(); ++it)
identifiers.push_back(it->first);
@ -442,6 +445,9 @@ void CefBrowserHostImpl::GetFrameIdentifiers(std::vector<int64>& identifiers) {
void CefBrowserHostImpl::GetFrameNames(std::vector<CefString>& names) {
base::AutoLock lock_scope(state_lock_);
if (names.size() > 0)
names.clear();
FrameMap::const_iterator it = frames_.begin();
for (; it != frames_.end(); ++it)
names.push_back(it->second->GetName());