CefAddCrossOriginWhitelistEntry crashing

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.

CefAddCrossOriginWhitelistEntry crashing

Postby MelK » Thu Feb 07, 2013 6:30 pm

I've been tossed a project that uses the CEF and I find myself in over my head.

As near as I can tell, it is single threaded, uses code based off the sample client, Unicode. Built under VS2010.

I've been asked "can you get this working": trying out the whitelisting functionality, to whitelist a subdomain over HTTP and HTTPS. I found CefAddCrossOriginWhitelistEntry function that would do the trick, ... if I could get it to work. But: I don't know the proper place to put the calls, or even if I am using them correctly.

I've tried adding lines like:

Code: Select all
CefAddCrossOriginWhitelistEntry(L"side1.mydomain.com", L"HTTP",  L"side2.mydomain.com", false);
CefAddCrossOriginWhitelistEntry(L"side1.mydomain.com", L"HTTPS",  L"side2.mydomain.com", false);


I've tried: in the main thread just after creating the settings (before creating browser window), and in OnLoadStart() and OnAfterCreated().

The only commentary specific to this function is here, directing me to a test suite that might substitute well for martian, for all that I can follow it. Important context things (base/test/test_suite.h is not in the CEF download) seem to be missing, or it is assumed that the reader is familiar with such test suites (which I am not).

I understand (only from comments in the test suite) that the "http" and "https" schemes are predefined or default, so I have assumed that they exist somewhere such that they could be called for the target protocol parameter. Tracing through the code, I get to:

Code: Select all
int _retval = cef_add_cross_origin_whitelist_entry(
      source_origin.GetStruct(),
      target_protocol.GetStruct(),
      target_domain.GetStruct(),
      allow_target_subdomains);


But executing that "hits a breakpoint" in some call about 5 levels deep into the library, far past where I can trace.

So. What am I doing wrong? Feel free to make a list.
MelK
Newbie
 
Posts: 3
Joined: Thu Feb 07, 2013 6:01 pm

Re: CefAddCrossOriginWhitelistEntry crashing

Postby magreenblatt » Thu Feb 07, 2013 7:40 pm

The usage should be:
Code: Select all
CefAddCrossOriginWhitelistEntry(L"http://side1.mydomain.com", L"http",  L"side2.mydomain.com", false);
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: CefAddCrossOriginWhitelistEntry crashing

Postby MelK » Fri Feb 08, 2013 12:44 pm

So include the "http" on the source, but not the target? (Much, now that I look for that in particular, as the unit test uses.)

Specifying a protocol for the source implies that more than one protocol may be involved in a transaction. For instance, I would need to specify four variants (http / https origin, against each of http / https from target). Or at least any such combination I wanted to permit. True?
MelK
Newbie
 
Posts: 3
Joined: Thu Feb 07, 2013 6:01 pm

Re: CefAddCrossOriginWhitelistEntry crashing

Postby magreenblatt » Fri Feb 08, 2013 1:00 pm

MelK wrote:So include the "http" on the source, but not the target? (Much, now that I look for that in particular, as the unit test uses.)

Specifying a protocol for the source implies that more than one protocol may be involved in a transaction. For instance, I would need to specify four variants (http / https origin, against each of http / https from target). Or at least any such combination I wanted to permit. True?

Yes to all.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 28 guests