Store value/state string for use in browser process.

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.

Store value/state string for use in browser process.

Postby daka1 » Wed Feb 25, 2015 7:26 am

What is the preferred way to store an application state, f ex. a bool: userAuthenticated=true/false.

Should I add these types of attributes to main_context_impl if I intend to extend simple client?

I get the state from the javascript side to the render process and pass it back to client_handler.cc, from there I want to be able to save/store the application state somewhere so that i can get this later from the ObjectiveC++ code, to update NSMenus etc.

Is there a predefined place for such a key-value store :?:
daka1
Techie
 
Posts: 42
Joined: Fri Feb 20, 2015 4:49 am

Re: Store value/state string for use in browser process.

Postby magreenblatt » Wed Feb 25, 2015 11:26 am

daka1 wrote:Is there a predefined place for such a key-value store :?:

Not specifically. If the settings are global to the whole application than MainContextImpl (or RootWindowManager in trunk) seems a reasonable place to store them.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Store value/state string for use in browser process.

Postby daka1 » Thu Feb 26, 2015 5:02 am

I am having some issues still, I take it is recommended to use the CefRefPtr class for handling refcounting/releaseing of the map....

Reconsidered it....

I am using a std::map<CefString,CefString>

The strings probably get free'd properly by cef...

The map should not need any manual freeing...

Good to go. Thank you
daka1
Techie
 
Posts: 42
Joined: Fri Feb 20, 2015 4:49 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 103 guests