cloudtrends / chromiumembedded

Automatically exported from code.google.com/p/chromiumembedded
1 stars 1 forks source link

The "CefWebUrlRequest for a "CefWebURLRequestClient" sometimes accidentally matches to a CefBrowser. #204

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use this to start a WebURLRequest  (HTTP download.)
bool StartWebURLRequestClient(CefWebURLRequestClient* client, CefString& url)
{
  CefRefPtr<CefWebURLRequestClient> spClient = client; 
  CefRefPtr<CefRequest> request(CefRequest::CreateRequest());
  request->SetURL(url);

  CefRefPtr<CefWebURLRequest> requester(
    CefWebURLRequest::CreateWebURLRequest(request, spClient));

  return true;
}

2. Usually the first time this will accidentally match a browser, so in 
addition to the CefWebURLRequestClient methods. 
CefHandler::HandleDownloadResponse will be called too.

(I saw this all the time in release builds that were started stand alone.  I 
did not see this if the the release build was run from the debugger.)

What is the expected output? What do you see instead?

  Only the CefWebURLRequestClient methods should be called, because the CefBrowser did not start the download.

What version of the product are you using? On what operating system?

  Cef 195, on MS-Windows.

Please provide any additional information below.
  This is a CefContext initialization bug.  
    CefContext::RemoveBrowser would reset next_browser_id_ to 1, but 
    CefContext::CefContext did not initialize next_browser_id_ to 1,
so sometimes the ID 0 would be used, and this accidentally matched the 
CefWebUrlRequest's id.

Original issue reported on code.google.com by Fe3...@gmail.com on 11 Mar 2011 at 8:14

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by magreenb...@gmail.com on 11 Mar 2011 at 8:16

GoogleCodeExporter commented 9 years ago
Thanks, committed as revision 205 with the following changes:

1. Chromium/CEF prefix constant variable names with 'k' (Hungarian notation).
2. Constructor initialization list order needs to match class declaration order 
or Mac throws compile errors.

Original comment by magreenb...@gmail.com on 22 Mar 2011 at 11:16