CreateBrowserSync call doesn't return

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

CreateBrowserSync call doesn't return

Postby rvc » Fri Nov 15, 2013 7:26 am

Hey,

I'm trying to launch a cef3 browser, using cef_binary_3.1547.1412_windows32, but execution is being blocked on CreateBrowserSync, so it doesn't show anything.

This is what I have:

Code: Select all
#include "cefclient/cefclient.h"
#include "cefclient/client_handler.h"

class RenderHandler : public CefRenderHandler
{
   std::shared_ptr<Texture> Texture;

public:
   RenderHandler(){};
   RenderHandler(const std::shared_ptr<Texture> &Texture);

   virtual bool GetRootScreenRect(CefRefPtr<CefBrowser> browser, CefRect& rect);
   virtual bool GetViewRect(CefRefPtr<CefBrowser> browser, CefRect& rect);
   virtual void OnPaint(CefRefPtr<CefBrowser> browser,
                  PaintElementType type,
                  const RectList& dirtyRects,
                  const void* buffer,
                  int width, int height)
   {
      // copy stuff to Texture
   }
                  
protected:
   IMPLEMENT_REFCOUNTING(RenderHandler);
   IMPLEMENT_LOCKING(RenderHandler);
};

class BrowserClient : public CefClient
{
public:
    BrowserClient(RenderHandler *renderHandler)
        : m_renderHandler(renderHandler)
    {}

    virtual CefRefPtr<CefRenderHandler> GetRenderHandler() { return m_renderHandler; }

    CefRefPtr<CefRenderHandler> m_renderHandler;

    IMPLEMENT_REFCOUNTING(BrowserClient);
    IMPLEMENT_LOCKING(BrowserClient);
};


class MyBrowser : public EngineSubsystem
{
   CefMainArgs main_args;
   CefSettings settings;
   
   CefWindowInfo windowInfo;   
   
   RenderHandler* renderHandler;
   CefRefPtr<BrowserClient> browserClient;
      
   CefBrowserSettings browserSettings;
   
   CefRefPtr<CefBrowser> browser;

public:
   MyBrowser(){}
   
   int Init(const std::shared_ptr<Texture> &Texture)
   {
      settings.multi_threaded_message_loop = false;
      CefInitialize(main_args, settings, nullptr);
      
      windowInfo.SetAsOffScreen(nullptr);
      
      renderHandler = new RenderHandler(Texture);
      browserClient = new BrowserClient(renderHandler);

      browser = CefBrowserHost::CreateBrowserSync(windowInfo, browserClient.get(), "http://localhost:8080/", browserSettings);
   }
}


Is there anything I'm missing?

I don't know if it has anything to do with it, but I had to compile cef with "Multi-threaded Debug DLL (/MDd)", because my project was also like that.

Thanks
Last edited by rvc on Wed Nov 20, 2013 11:03 am, edited 1 time in total.
rvc
Newbie
 
Posts: 7
Joined: Fri Nov 15, 2013 7:02 am

Re: Off screen rendering block on CreateBrowserSync

Postby magreenblatt » Fri Nov 15, 2013 11:32 am

There are a number of things wrong with your code. You should read the GeneralUsage wiki page.
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: Off screen rendering block on CreateBrowserSync

Postby rvc » Tue Nov 19, 2013 11:57 am

So, I've read it, but I still struggle to understand how to build a simple sample.

I've changed the code to the following - basically copy-pasted MyApp and MyHandler form the GeneralUsage page, and follow the main from "Single Executable" part.

Code: Select all
// MyHandler implements CefClient and a number of other interfaces.
class MyHandler : public CefClient,
   public CefContextMenuHandler,
   public CefDisplayHandler,
   public CefDownloadHandler,
   public CefDragHandler,
   public CefGeolocationHandler,
   public CefKeyboardHandler,
   public CefLifeSpanHandler,
   public CefLoadHandler,
   public CefRequestHandler,
   public CefRenderHandler
{
public:
   // CefClient methods. Important to return |this| for the handler callbacks.
   virtual CefRefPtr<CefContextMenuHandler> GetContextMenuHandler() OVERRIDE {
      return this;
   }
   virtual CefRefPtr<CefDisplayHandler> GetDisplayHandler() OVERRIDE {
      return this;
   }
   virtual CefRefPtr<CefDownloadHandler> GetDownloadHandler() OVERRIDE {
      return this;
   }
   virtual CefRefPtr<CefDragHandler> GetDragHandler() OVERRIDE {
      return this;
   }
   virtual CefRefPtr<CefGeolocationHandler> GetGeolocationHandler() OVERRIDE {
      return this;
   }
   virtual CefRefPtr<CefKeyboardHandler> GetKeyboardHandler() OVERRIDE {
      return this;
   }
   virtual CefRefPtr<CefLifeSpanHandler> GetLifeSpanHandler() OVERRIDE {
      return this;
   }
   virtual CefRefPtr<CefLoadHandler> GetLoadHandler() OVERRIDE {
      return this;
   }
   virtual CefRefPtr<CefRenderHandler> GetRenderHandler() OVERRIDE {
      return this;
   }
   virtual CefRefPtr<CefRequestHandler> GetRequestHandler() OVERRIDE {
      return this;
   }
   virtual bool OnProcessMessageReceived(CefRefPtr<CefBrowser> browser,
      CefProcessId source_process,
      CefRefPtr<CefProcessMessage> message)
      OVERRIDE
   {
      // Handle IPC messages from the render process...
      return true;
   }

   // CefContextMenuHandler methods
   virtual void OnBeforeContextMenu(CefRefPtr<CefBrowser> browser,
      CefRefPtr<CefFrame> frame,
      CefRefPtr<CefContextMenuParams> params,
      CefRefPtr<CefMenuModel> model) OVERRIDE {
         // Customize the context menu...
   }
   virtual bool OnContextMenuCommand(CefRefPtr<CefBrowser> browser,
      CefRefPtr<CefFrame> frame,
      CefRefPtr<CefContextMenuParams> params,
      int command_id,
      EventFlags event_flags) OVERRIDE
   {
      // Handle a context menu command...
      return true;
   }

   // CefDisplayHandler methods
   virtual void OnLoadingStateChange(CefRefPtr<CefBrowser> browser,
      bool isLoading,
      bool canGoBack,
      bool canGoForward) OVERRIDE {
         // Update UI for browser state...
   }
   virtual void OnAddressChange(CefRefPtr<CefBrowser> browser,
      CefRefPtr<CefFrame> frame,
      const CefString& url) OVERRIDE {
         // Update the URL in the address bar...
   }
   virtual void OnTitleChange(CefRefPtr<CefBrowser> browser,
      const CefString& title) OVERRIDE {
         // Update the browser window title...
   }
   virtual bool OnConsoleMessage(CefRefPtr<CefBrowser> browser,
      const CefString& message,
      const CefString& source,
      int line) OVERRIDE
   {
      // Log a console message...
      return true;
   }

   // CefDownloadHandler methods
   virtual void OnBeforeDownload(
      CefRefPtr<CefBrowser> browser,
      CefRefPtr<CefDownloadItem> download_item,
      const CefString& suggested_name,
      CefRefPtr<CefBeforeDownloadCallback> callback) OVERRIDE {
         // Specify a file path or cancel the download...
   }
   virtual void OnDownloadUpdated(
      CefRefPtr<CefBrowser> browser,
      CefRefPtr<CefDownloadItem> download_item,
      CefRefPtr<CefDownloadItemCallback> callback) OVERRIDE {
         // Update the download status...
   }

   // CefDragHandler methods
   virtual bool OnDragEnter(CefRefPtr<CefBrowser> browser,
      CefRefPtr<CefDragData> dragData,
      DragOperationsMask mask) OVERRIDE
   {
      return true;
      // Allow or deny drag events...
   }

   // CefGeolocationHandler methods
   virtual void OnRequestGeolocationPermission(
      CefRefPtr<CefBrowser> browser,
      const CefString& requesting_url,
      int request_id,
      CefRefPtr<CefGeolocationCallback> callback) OVERRIDE {
         // Allow or deny geolocation API access...
   }

   // CefKeyboardHandler methods
   virtual bool OnPreKeyEvent(CefRefPtr<CefBrowser> browser,
      const CefKeyEvent& event,
      CefEventHandle os_event,
      bool* is_keyboard_shortcut) OVERRIDE
   {
      // Perform custom handling of key events...
      return true;
   }

   // CefLifeSpanHandler methods
   virtual bool OnBeforePopup(CefRefPtr<CefBrowser> browser,
      CefRefPtr<CefFrame> frame,
      const CefString& target_url,
      const CefString& target_frame_name,
      const CefPopupFeatures& popupFeatures,
      CefWindowInfo& windowInfo,
      CefRefPtr<CefClient>& client,
      CefBrowserSettings& settings,
      bool* no_javascript_access) OVERRIDE
   {
      // Allow or block popup windows, customize popup window creation...
      return true;
   }

   virtual void OnAfterCreated(CefRefPtr<CefBrowser> browser) OVERRIDE {
      // Browser window created successfully...
      // Must be executed on the UI thread.
      REQUIRE_UI_THREAD();
      // Protect data members from access on multiple threads.
      AutoLock lock_scope(this);

      if (!m_Browser.get())   {
         // Keep a reference to the main browser.
         m_Browser = browser;
         m_BrowserId = browser->GetIdentifier();
      }

      // Keep track of how many browsers currently exist.
      m_BrowserCount++;
   }
   virtual bool DoClose(CefRefPtr<CefBrowser> browser) OVERRIDE {
      // Allow or block browser window close...
      return true;
   }
   virtual void OnBeforeClose(CefRefPtr<CefBrowser> browser) OVERRIDE {
      // Browser window is closed, perform cleanup...
   }

   // CefLoadHandler methods
   virtual void OnLoadStart(CefRefPtr<CefBrowser> browser,
      CefRefPtr<CefFrame> frame) OVERRIDE {
         // A frame has started loading content...
   }
   virtual void OnLoadEnd(CefRefPtr<CefBrowser> browser,
      CefRefPtr<CefFrame> frame,
      int httpStatusCode) OVERRIDE {
         // A frame has finished loading content...
   }
   virtual void OnLoadError(CefRefPtr<CefBrowser> browser,
      CefRefPtr<CefFrame> frame,
      ErrorCode errorCode,
      const CefString& errorText,
      const CefString& failedUrl) OVERRIDE {
         // A frame has failed to load content...
   }
   virtual void OnRenderProcessTerminated(CefRefPtr<CefBrowser> browser,
      TerminationStatus status) OVERRIDE {
         // A render process has crashed...
   }

   // CefRequestHandler methods
   virtual CefRefPtr<CefResourceHandler> GetResourceHandler(
      CefRefPtr<CefBrowser> browser,
      CefRefPtr<CefFrame> frame,
      CefRefPtr<CefRequest> request) OVERRIDE
   {
      return NULL;
   }
   virtual bool OnQuotaRequest(CefRefPtr<CefBrowser> browser,
      const CefString& origin_url,
      int64 new_size,
      CefRefPtr<CefQuotaCallback> callback) OVERRIDE
   {
      // Allow or block quota requests...
      return true;
   }
   virtual void OnProtocolExecution(CefRefPtr<CefBrowser> browser,
      const CefString& url,
      bool& allow_os_execution) OVERRIDE {
         // Handle execution of external protocols...
   }

   // CefRenderHandler methods
   virtual bool GetRootScreenRect(CefRefPtr<CefBrowser> browser,
      CefRect& rect) OVERRIDE
   {
      return true;
   }
   virtual bool GetViewRect(CefRefPtr<CefBrowser> browser,
      CefRect& rect) OVERRIDE
   {
      return true;
   }
   virtual bool GetScreenPoint(CefRefPtr<CefBrowser> browser,
      int viewX,
      int viewY,
      int& screenX,
      int& screenY) OVERRIDE
   {
      return true;
   }
   virtual bool GetScreenInfo(CefRefPtr<CefBrowser> browser,
      CefScreenInfo& screen_info) OVERRIDE
   {
      return true;
   }
   virtual void OnPopupShow(CefRefPtr<CefBrowser> browser, bool show) OVERRIDE
   {
   }
   virtual void OnPopupSize(CefRefPtr<CefBrowser> browser,
      const CefRect& rect) OVERRIDE
   {
   }
   virtual void OnPaint(CefRefPtr<CefBrowser> browser,
      PaintElementType type,
      const RectList& dirtyRects,
      const void* buffer,
      int width,
      int height) OVERRIDE
   {
      std::cout << "OnPaint" << std::endl;
   }

   // Member accessors.
   CefRefPtr<CefBrowser> GetBrower() { return m_Browser; }
   bool IsClosing() { return m_bIsClosing; }

private:
   CefRefPtr<CefBrowser> m_Browser;
   int m_BrowserId;
   int m_BrowserCount;
   bool m_bIsClosing;

   IMPLEMENT_REFCOUNTING(MyHandler);
   IMPLEMENT_LOCKING(MyHandler);
};

// MyApp implements CefApp and the process-specific interfaces.
class MyApp : public CefApp,
   public CefBrowserProcessHandler,
   public CefRenderProcessHandler
{
public:
   // CefApp methods. Important to return |this| for the handler callbacks.
   virtual void OnBeforeCommandLineProcessing(
      const CefString& process_type,
      CefRefPtr<CefCommandLine> command_line) {
         // Programmatically configure command-line arguments...
   }
   virtual void OnRegisterCustomSchemes(
      CefRefPtr<CefSchemeRegistrar> registrar) OVERRIDE {
         // Register custom schemes...
   }
   virtual CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler()
      OVERRIDE { return this; }
   virtual CefRefPtr<CefRenderProcessHandler> GetRenderProcessHandler()
      OVERRIDE { return this; }

   // CefBrowserProcessHandler methods.
   virtual void OnContextInitialized() OVERRIDE {
      // The browser process UI thread has been initialized...
   }
   virtual void OnRenderProcessThreadCreated(CefRefPtr<CefListValue> extra_info)
      OVERRIDE {
         // Send startup information to a new render process...
   }

   // CefRenderProcessHandler methods.
   virtual void OnRenderThreadCreated(CefRefPtr<CefListValue> extra_info)
      OVERRIDE {
         // The render process main thread has been initialized...
         // Receive startup information in the new render process...
   }
   //virtual void OnWebKitInitialized(CefRefPtr<ClientApp> app) OVERRIDE {
   // WebKit has been initialized, register V8 extensions...
   // }
   virtual void OnBrowserCreated(CefRefPtr<CefBrowser> browser) OVERRIDE {
      // Browser created in this render process...
   }
   virtual void OnBrowserDestroyed(CefRefPtr<CefBrowser> browser) OVERRIDE {
      // Browser destroyed in this render process...
   }
   virtual bool OnBeforeNavigation(CefRefPtr<CefBrowser> browser,
      CefRefPtr<CefFrame> frame,
      CefRefPtr<CefRequest> request,
      NavigationType navigation_type,
      bool is_redirect) OVERRIDE {
         // Allow or block different types of navigation...
         return false;
   }
   virtual void OnContextCreated(CefRefPtr<CefBrowser> browser,
      CefRefPtr<CefFrame> frame,
      CefRefPtr<CefV8Context> context) OVERRIDE {
         // JavaScript context created, add V8 bindings here...
   }
   virtual void OnContextReleased(CefRefPtr<CefBrowser> browser,
      CefRefPtr<CefFrame> frame,
      CefRefPtr<CefV8Context> context) OVERRIDE {
         // JavaScript context released, release V8 references here...
   }
   virtual bool OnProcessMessageReceived(
      CefRefPtr<CefBrowser> browser,
      CefProcessId source_process,
      CefRefPtr<CefProcessMessage> message) OVERRIDE {
         // Handle IPC messages from the browser process...
         return false;
   }

   IMPLEMENT_REFCOUNTING(MyApp);
};

class MyBrowser
{
   // Structure for passing command-line arguments.
   // The definition of this structure is platform-specific.
   CefMainArgs main_args;

   // Optional implementation of the CefApp interface.
   CefRefPtr<MyApp> app;

   // CefClient implementation.
   CefRefPtr<MyHandler> client;

   CefSettings settings;
   CefBrowserSettings browserSettings;
   CefWindowInfo info;

   CefRefPtr<CefBrowser> browser;

public:
   int Initialize(const std::shared_ptr<Engine>& engine)
   {
      app = new MyApp;

      // Execute the sub-process logic, if any. This will either return immediately for the browser
      // process or block until the sub-process should exit.
      int exit_code = CefExecuteProcess(main_args, nullptr);
      if (exit_code >= 0) {
         // The sub-process terminated, exit now.
         return exit_code;
      }

      settings.log_severity = LOGSEVERITY_VERBOSE;
      settings.command_line_args_disabled = true;
      settings.multi_threaded_message_loop = false; // (Windows only)

      // Initialize CEF in the main process.
      CefInitialize(main_args, settings, app.get());


      // Information about the window that will be created including parenting, size, etc.
      // The definition of this structure is platform-specific.
      info.SetAsOffScreen(nullptr);
      info.SetTransparentPainting(false);

      // CefClient implementation.
      client = new MyHandler;

      browser = CefBrowserHost::CreateBrowserSync(info, client.get(), "http://localhost:8080/", browserSettings);

      return 1;
   }

   int step(const double frameTime)
   {
      CefDoMessageLoopWork();
      return 1;
   }


   ~MyBrowser()
   {
      // Shut down CEF.
      app = nullptr;
      browser = nullptr;
      client = nullptr;
      CefShutdown();
   }
};


Also copied the code to pastbin in case it's easier to read.

I just wanted to initialize the browser for now, but it continues to lock on CreateBrowserSync, so I'm still missing something.

Sorry for my newbyness :oops:, I really appreciate the help a lot.
Many thanks. :)
rvc
Newbie
 
Posts: 7
Joined: Fri Nov 15, 2013 7:02 am

Re: Off screen rendering block on CreateBrowserSync

Postby magreenblatt » Tue Nov 19, 2013 11:55 pm

You're probably not running the message loop correctly or doing something from the wrong thread. Did you try breaking with the debugger to see what it's blocked on? You can get VS2010 debug symbols from the downloads page for a meaningful stack trace. You can also try creating the browser from OnContextInitialized after starting the message loop.
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: Off screen rendering block on CreateBrowserSync

Postby rvc » Wed Nov 20, 2013 10:01 am

So I have downloaded cef_binary_3.1650.1514_windows32 and cef_binary_3.1650.1514_windows32_debug_symbols from http://cefbuilds.com/.
And then copy-pasted the libcef folder (which contains browser, common, render, and resources folders) from http://chromiumembedded.googlecode.com/ ... /1650/cef3, into the root of cef_binary_3.1650.1514_windows32, and I managed to find out the blocking is happening in browser_host_impl.cc, in the LoadURL() function. It doesn't get out of this function call:

Code: Select all
web_contents_->GetController().LoadURL(
            gurl,
            referrer,
            transition,
            extra_headers);
OnSetFocus(FOCUS_SOURCE_NAVIGATION);


I couldn't go further because I couldn't find the web_contents source code, but execution doesn't reach OnSetFocus.

I'm now testing with "http://www.google.com" instead of localhost, but it's still blocking.

So checking the function arguments, I see gurl is "http://www.google.com/" and valid, Referrer and the extra_headers are empty and transition is PAGE_TRANSITION_TYPED (1).

This is the only thing I get on the console with settings.log_severity = LOGSEVERITY_VERBOSE; :
[1120/142015:VERBOSE1:pref_proxy_config_tracker_impl.cc(148)] 00B7CDC0: set chrome proxy config service to 00B7CC80
[1120/142015:VERBOSE1:pref_proxy_config_tracker_impl.cc(274)] 00B7CDC0: Done pushing proxy to UpdateProxyConfig


I've also tried to move the browser creation to OnContextInitialized, inside MyApp class, like so:
Code: Select all
// MyApp implements CefApp and the process-specific interfaces.
class MyApp : public CefApp,
              public CefBrowserProcessHandler,
              public CefRenderProcessHandler
{
 public:   
   CefMainArgs main_args;
   CefRefPtr<MyHandler> client;
   CefSettings settings;
   CefBrowserSettings browserSettings;
   CefWindowInfo info;

   CefRefPtr<CefBrowser> browser;
   
   CefRefPtr<CefRequestContext> request_context;
 
  MyApp()
  {
   CefExecuteProcess(main_args, nullptr);

   settings.log_severity = LOGSEVERITY_VERBOSE;
   settings.command_line_args_disabled = true;
   settings.multi_threaded_message_loop = false; // (Windows only)   

   info.SetAsOffScreen(nullptr);
   info.SetTransparentPainting(false);

   client = new MyHandler();

   CefInitialize(main_args, settings, this);
  }
  // CefBrowserProcessHandler methods.
  virtual void OnContextInitialized() OVERRIDE {
    // The browser process UI thread has been initialized...
     browser = CefBrowserHost::CreateBrowserSync(info, client.get(), "http://www.google.com/", browserSettings, request_context);
  }

... other functions ...


But didn't make any difference, still blocks on web_contents_->GetController().LoadURL. :(

edit: also tried without off screen rendering, by using info.SetAsPopup(). Indeed it pops up a new window, but it still blocks on the same place.
rvc
Newbie
 
Posts: 7
Joined: Fri Nov 15, 2013 7:02 am

Re: Off screen rendering block on CreateBrowserSync

Postby magreenblatt » Wed Nov 20, 2013 11:02 am

Please post the full stack trace for the blocking code.
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: CreateBrowserSync call doesn't return

Postby rvc » Wed Nov 20, 2013 11:24 am

post below is more complete
Last edited by rvc on Fri Nov 22, 2013 6:33 am, edited 2 times in total.
rvc
Newbie
 
Posts: 7
Joined: Fri Nov 15, 2013 7:02 am

Re: CreateBrowserSync call doesn't return

Postby rvc » Fri Nov 22, 2013 6:32 am

stack trace for CrBrowserMain:

KernelBase.dll!762c3b63() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for KernelBase.dll]
KernelBase.dll!762c4498() Unknown
libcef.dll!base::PlatformThread::YieldCurrentThread() Line 133 C++
libcef.dll!base::internal::WaitForInstance(int * instance) Line 25 C++
libcef.dll!Singleton<base::debug::`anonymous namespace'::SymbolContext,LeakySingletonTraits<base::debug::`anonymous namespace'::SymbolContext>,base::debug::A0xd3e2a7a6::SymbolContext>::get() Line 261 C++
libcef.dll!base::debug::`anonymous namespace'::SymbolContext::GetInstance() Line 61 C++
libcef.dll!base::debug::StackTrace::OutputToStream(std::basic_ostream<char,std::char_traits<char> > * os) Line 256 C++
libcef.dll!logging::LogMessage::~LogMessage() Line 569 C++
libcef.dll!base::ThreadRestrictions::AssertIOAllowed() Line 45 C++
libcef.dll!base::MakeAbsoluteFilePath(const base::FilePath & input) Line 80 C++
libcef.dll!PathService::Get(int key, base::FilePath * result) Line 221 C++
libcef.dll!content::PathProvider(int key, base::FilePath * result) Line 16 C++
libcef.dll!PathService::Get(int key, base::FilePath * result) Line 210 C++
libcef.dll!content::ChildProcessHost::GetChildPath(int flags) Line 107 C++
libcef.dll!content::RenderProcessHostImpl::Init() Line 452 C++
libcef.dll!content::RenderViewHostImpl::CreateRenderView(const std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > & frame_name, int opener_route_id, int max_page_id) Line 237 C++
libcef.dll!content::WebContentsImpl::CreateRenderViewForRenderManager(content::RenderViewHost * render_view_host, int opener_route_id) Line 3789 C++
libcef.dll!content::RenderViewHostManager::InitRenderView(content::RenderViewHost * render_view_host, int opener_route_id) Line 710 C++
libcef.dll!content::RenderViewHostManager::Navigate(const content::NavigationEntryImpl & entry) Line 156 C++
libcef.dll!content::WebContentsImpl::NavigateToEntry(const content::NavigationEntryImpl & entry, content::NavigationController::ReloadType reload_type) Line 1823 C++
libcef.dll!content::WebContentsImpl::NavigateToPendingEntry(content::NavigationController::ReloadType reload_type) Line 1780 C++
libcef.dll!content::NavigationControllerImpl::NavigateToPendingEntry(content::NavigationController::ReloadType reload_type) Line 1547 C++
libcef.dll!content::NavigationControllerImpl::LoadEntry(content::NavigationEntryImpl * entry) Line 390 C++
libcef.dll!content::NavigationControllerImpl::LoadURLWithParams(const content::NavigationController::LoadURLParams & params) Line 711 C++
libcef.dll!content::NavigationControllerImpl::LoadURL(const GURL & url, const content::Referrer & referrer, content::PageTransition transition, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & extra_headers) Line 627 C++
libcef.dll!CefBrowserHostImpl::LoadURL(__int64 frame_id, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & url, const content::Referrer & referrer, content::PageTransition transition, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & extra_headers) Line 1268 C++
libcef.dll!CefBrowserHost::CreateBrowserSync(const CefWindowInfo & windowInfo, CefRefPtr<CefClient> client, const CefStringBase<CefStringTraitsUTF16> & url, const CefStructBase<CefBrowserSettingsTraits> & settings, CefRefPtr<CefRequestContext> request_context) Line 318 C++
libcef.dll!cef_browser_host_create_browser_sync(const _cef_window_info_t * windowInfo, _cef_client_t * client, const _cef_string_utf16_t * url, const _cef_browser_settings_t * settings, _cef_request_context_t * request_context) Line 91 C++
> GameEngine.exe!CefBrowserHost::CreateBrowserSync(const CefWindowInfo & windowInfo, CefRefPtr<CefClient> client, const CefStringBase<CefStringTraitsUTF16> & url, const CefStructBase<CefBrowserSettingsTraits> & settings, CefRefPtr<CefRequestContext> request_context) Line 57 C++
GameEngine.exe!GUISubsystem::Initialize(const std::shared_ptr<Engine> & engine) Line 53 C++
GameEngine.exe!Engine::Initialize() Line 38 C++
GameEngine.exe!main(int argc, char * * argv) Line 34 C++
GameEngine.exe!__tmainCRTStartup() Line 536 C
GameEngine.exe!mainCRTStartup() Line 377 C
kernel32.dll!761b336a() Unknown
ntdll.dll!77a99f72() Unknown
ntdll.dll!77a99f45() Unknown


stack trace for Chrome_IOThread:
ntdll.dll!77a7fd91() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.dll!77a7fd91() Unknown
KernelBase.dll!762c3bc8() Unknown
KernelBase.dll!762c4498() Unknown
libcef.dll!base::PlatformThread::YieldCurrentThread() Line 133 C++
libcef.dll!base::internal::WaitForInstance(int * instance) Line 25 C++
libcef.dll!Singleton<base::debug::`anonymous namespace'::SymbolContext,LeakySingletonTraits<base::debug::`anonymous namespace'::SymbolContext>,base::debug::A0xd3e2a7a6::SymbolContext>::get() Line 261 C++
libcef.dll!base::debug::`anonymous namespace'::SymbolContext::GetInstance() Line 61 C++
libcef.dll!base::debug::StackTrace::OutputToStream(std::basic_ostream<char,std::char_traits<char> > * os) Line 256 C++
libcef.dll!logging::LogMessage::~LogMessage() Line 569 C++
libcef.dll!base::ThreadRestrictions::AssertIOAllowed() Line 45 C++
libcef.dll!base::MakeAbsoluteFilePath(const base::FilePath & input) Line 80 C++
libcef.dll!PathService::Get(int key, base::FilePath * result) Line 221 C++
libcef.dll!base::debug::`anonymous namespace'::SymbolContext::SymbolContext() Line 168 C++
libcef.dll!DefaultSingletonTraits<base::debug::`anonymous namespace'::SymbolContext>::New() Line 54 C++
libcef.dll!Singleton<base::debug::`anonymous namespace'::SymbolContext,LeakySingletonTraits<base::debug::`anonymous namespace'::SymbolContext>,base::debug::A0xd3e2a7a6::SymbolContext>::get() Line 245 C++
libcef.dll!base::debug::`anonymous namespace'::SymbolContext::GetInstance() Line 61 C++
libcef.dll!base::debug::StackTrace::OutputToStream(std::basic_ostream<char,std::char_traits<char> > * os) Line 256 C++
libcef.dll!logging::LogMessage::~LogMessage() Line 569 C++
libcef.dll!base::ThreadRestrictions::AssertIOAllowed() Line 45 C++
libcef.dll!base::MakeAbsoluteFilePath(const base::FilePath & input) Line 80 C++
libcef.dll!PathService::Get(int key, base::FilePath * result) Line 221 C++
libcef.dll!content::PathProvider(int key, base::FilePath * result) Line 16 C++
libcef.dll!PathService::Get(int key, base::FilePath * result) Line 210 C++
libcef.dll!content::ChildProcessHost::GetChildPath(int flags) Line 107 C++
libcef.dll!content::GpuProcessHost::LaunchGpuProcess(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & channel_id) Line 1103 C++
libcef.dll!content::GpuProcessHost::Init() Line 588 C++
libcef.dll!content::GpuProcessHost::Get(content::GpuProcessHost::GpuProcessKind kind, content::CauseForGpuLaunch cause) Line 334 C++
libcef.dll!base::internal::RunnableAdapter<content::GpuProcessHost * (__cdecl*)(enum content::GpuProcessHost::GpuProcessKind,enum content::CauseForGpuLaunch)>::Run(const content::GpuProcessHost::GpuProcessKind & a1, const content::CauseForGpuLaunch & a2) Line 228 C++
libcef.dll!base::internal::InvokeHelper<0,void,base::internal::RunnableAdapter<content::GpuProcessHost * (__cdecl*)(enum content::GpuProcessHost::GpuProcessKind,enum content::CauseForGpuLaunch)>,void __cdecl(enum content::GpuProcessHost::GpuProcessKind const &,enum content::CauseForGpuLaunch const &)>::MakeItSo(base::internal::RunnableAdapter<content::GpuProcessHost * (__cdecl*)(enum content::GpuProcessHost::GpuProcessKind,enum content::CauseForGpuLaunch)> runnable, const content::GpuProcessHost::GpuProcessKind & a1, const content::CauseForGpuLaunch & a2) Line 899 C++
libcef.dll!base::internal::Invoker<2,base::internal::BindState<base::internal::RunnableAdapter<content::GpuProcessHost * (__cdecl*)(enum content::GpuProcessHost::GpuProcessKind,enum content::CauseForGpuLaunch)>,void __cdecl(enum content::GpuProcessHost::GpuProcessKind,enum content::CauseForGpuLaunch),void __cdecl(enum content::GpuProcessHost::GpuProcessKind,enum content::CauseForGpuLaunch)>,void __cdecl(enum content::GpuProcessHost::GpuProcessKind,enum content::CauseForGpuLaunch)>::Run(base::internal::BindStateBase * base) Line 1253 C++
libcef.dll!base::Callback<void __cdecl(void)>::Run() Line 396 C++
libcef.dll!base::MessageLoop::RunTask(const base::PendingTask & pending_task) Line 493 C++
libcef.dll!base::MessageLoop::DeferOrRunPendingTask(const base::PendingTask & pending_task) Line 506 C++
libcef.dll!base::MessageLoop::DoWork() Line 617 C++
libcef.dll!base::MessagePumpForIO::DoRunLoop() Line 529 C++
libcef.dll!base::MessagePumpWin::RunWithDispatcher(base::MessagePump::Delegate * delegate, base::MessagePumpDispatcher * dispatcher) Line 65 C++
libcef.dll!base::MessagePumpWin::Run(base::MessagePump::Delegate * delegate) Line 48 C++
libcef.dll!base::MessageLoop::RunInternal() Line 441 C++
libcef.dll!base::MessageLoop::RunHandler() Line 414 C++
libcef.dll!base::RunLoop::Run() Line 48 C++
libcef.dll!base::MessageLoop::Run() Line 312 C++
libcef.dll!base::Thread::Run(base::MessageLoop * message_loop) Line 160 C++
libcef.dll!content::BrowserThreadImpl::IOThreadRun(base::MessageLoop * message_loop) Line 163 C++
libcef.dll!content::BrowserThreadImpl::Run(base::MessageLoop * message_loop) Line 188 C++
libcef.dll!base::Thread::ThreadMain() Line 219 C++
libcef.dll!base::`anonymous namespace'::ThreadFunc(void * params) Line 74 C++
kernel32.dll!761b336a() Unknown
ntdll.dll!77a99f72() Unknown
ntdll.dll!77a99f45() Unknown


Is this a Deadlock?

If you need the stack trace from any of the other threads, let me know.

Thanks.

edit: I just found out it doesn't block if I run without the Debugger.
rvc
Newbie
 
Posts: 7
Joined: Fri Nov 15, 2013 7:02 am

Re: CreateBrowserSync call doesn't return

Postby magreenblatt » Fri Nov 22, 2013 9:38 am

This is an assertion, not a deadlock. It looks like viewtopic.php?f=6&t=10725
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: CreateBrowserSync call doesn't return

Postby zpucky » Wed Dec 18, 2013 11:56 am

I'm experiencing the same exact issue rvc is describing.

I ended trying to create a copy of 'cefsimple' project, with the exact same result:

* 'cefsimple' project, inside 'cef3' solution, works perfectly.
* 'cefsimple' project, outside 'cef3' solution, exactly the same code, doesn't start, it hangs at the same point @rvc described.

The thing is, this only happens when I launch the project from VS2010. If I execute the output file manually, it works well. I've copied the project configuration from one to the other, but still I can't manage to get it working.

More details:

* Visual Studio 2010
* Cef 3.1650

I can send a zipped self-contained 'cefsimple' project if needed.

@rvc, have you tried to start the output file manually?
zpucky
Newbie
 
Posts: 2
Joined: Wed Dec 18, 2013 11:47 am

Next

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 51 guests