URLRequestContextGetter question

52 views
Skip to first unread message

all smooth

unread,
May 20, 2013, 4:28:20 PM5/20/13
to chromi...@chromium.org
Hi, 
I am working on to use chromiume/net module code in one proejct. Since I want to use URLFetcher to send my own http request inside URLRequest or URLRequestContext class. However before I use URLFetcher I need to have the pointer to URLRequestContextGetter. If there is a way to get this pointer from URLRequest or URLRequestContext class? I can add a memeber inside class and assign value from FetcherCore class, but this will introduce the recompiling the whole chrome project since header file is changed. There might be some easier way to get this context getter pointer I am not aware of. 

thanks,



Christian Biesinger

unread,
May 20, 2013, 4:53:28 PM5/20/13
to guangyuan li, chromium-dev
Why not implement the class yourself?

-christian
> --
> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev
>
>
>

all smooth

unread,
May 20, 2013, 5:02:56 PM5/20/13
to chromi...@chromium.org, guangyuan li


On Monday, May 20, 2013 1:53:28 PM UTC-7, Christian Biesinger wrote:
Why not implement the class yourself?

I am afraid there is a lot of things need to take care for creating this pointer by myself. I did it in command line (without using Chrome), and it's fine. But now I will run this part of code inside Chrome, and this request should share the same request context getter pointer with others.  Then I think it's much easier and clean for me to re use this context getter. 
 -all smooth

Fred Akalin

unread,
May 20, 2013, 6:02:10 PM5/20/13
to guangyuan li, chromium-dev
You should then pass around the request context getter to whatever needs it. You might want the ChromeURLRequestContextGetter class from chrome/browser/net/chrome_url_request_context.h if you're working in chrome/ code.

all smooth

unread,
May 20, 2013, 6:15:05 PM5/20/13
to chromi...@chromium.org, guangyuan li
In the end it's from ChromeURLRequestContextGetter pointer. I feel it's not good to change the header file since I want net module change doesnot affect anything on up layer. Now seems this rule is broken. 

Do you think I can replicate the context getter insdie URLRequestContext based on *this* pointer?

Fred Akalin

unread,
May 20, 2013, 6:19:41 PM5/20/13
to guangyuan li, chromium-dev
You really shouldn't. Ideally, the URLRequestContext shouldn't need to know about how it was created. You should instead figure out how to access the ChromeURLRequestContextGetter from wherever you are, or pass it down somehow.

all smooth

unread,
May 20, 2013, 6:38:20 PM5/20/13
to chromi...@chromium.org, guangyuan li


On Monday, May 20, 2013 3:19:41 PM UTC-7, Fred Akalin wrote:
You really shouldn't. Ideally, the URLRequestContext shouldn't need to know about how it was created. You should instead figure out how to access the ChromeURLRequestContextGetter from wherever you are, or pass it down somehow.
Then it can mot meet my needs. Since it has to change URLRequest interface by adding Getter variable to pass down, then by just replacing net.dll the existing chrome cannot run properly. There is going to be runtime crash except recompile the whole chrome. My purpose is not to replace the whole chrome.

Fred Akalin

unread,
May 21, 2013, 12:10:21 AM5/21/13
to guangyuan li, chromium-dev
On Mon, May 20, 2013 at 3:38 PM, all smooth <guang...@gmail.com> wrote:
Then it can mot meet my needs. Since it has to change URLRequest interface by adding Getter variable to pass down, then by just replacing net.dll the existing chrome cannot run properly. There is going to be runtime crash except recompile the whole chrome. My purpose is not to replace the whole chrome.

Hmm, why exactly is this a requirement? As far as I know, there's no net.dll in any version of Chrome. They're only split out into separate DLLs for developer builds (for speed of compilation).

all smooth

unread,
May 21, 2013, 3:15:40 PM5/21/13
to chromi...@chromium.org, guangyuan li
I am still prototyping, and the requirement is not clear. At this time, I just want to limit the impact to minimum. 

Thanks for reply.
all smooth
Reply all
Reply to author
Forward
0 new messages