Index: chrome/browser/automation/automation_util.cc |
=================================================================== |
--- chrome/browser/automation/automation_util.cc (revision 82344) |
+++ chrome/browser/automation/automation_util.cc (working copy) |
@@ -11,12 +11,13 @@ |
#include "base/values.h" |
#include "chrome/browser/automation/automation_provider.h" |
#include "chrome/browser/automation/automation_provider_json.h" |
+#include "chrome/browser/extensions/extension_service.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/ui/browser.h" |
#include "chrome/browser/ui/browser_list.h" |
#include "chrome/browser/ui/browser.h" |
#include "content/browser/browser_thread.h" |
-#include "content/browser/renderer_host/browser_render_process_host.h" |
+#include "content/browser/renderer_host/render_process_host.h" |
#include "content/browser/renderer_host/render_view_host.h" |
#include "content/browser/tab_contents/tab_contents.h" |
#include "net/base/cookie_monster.h" |
@@ -105,19 +106,22 @@ |
return browser->GetTabContentsAt(tab_index); |
} |
+net::URLRequestContextGetter* GetRequestContext(TabContents* contents) { |
+ const Extension* installed_app = NULL; |
Charlie Reis
2011/04/21 00:25:12
Don't need this line.
jam
2011/04/21 06:52:19
Done.
|
+ // Since we may be on the UI thread don't call GetURLRequestContext(). |
+ // Get the request context specific to the current TabContents and app. |
+ return contents->profile()->GetRequestContextForPossibleApp( |
+ contents->render_view_host()->process()->id()); |
+} |
+ |
void GetCookies(const GURL& url, |
TabContents* contents, |
int* value_size, |
std::string* value) { |
*value_size = -1; |
if (url.is_valid() && contents) { |
- // Since we may be on the UI thread don't call GetURLRequestContext(). |
- // Get the request context specific to the current TabContents and app. |
- const Extension* installed_app = static_cast<BrowserRenderProcessHost*>( |
- contents->render_view_host()->process())->installed_app(); |
scoped_refptr<net::URLRequestContextGetter> context_getter = |
- contents->profile()->GetRequestContextForPossibleApp(installed_app); |
- |
+ GetRequestContext(contents); |
base::WaitableEvent event(true /* manual reset */, |
false /* not initially signaled */); |
CHECK(BrowserThread::PostTask( |
@@ -137,13 +141,8 @@ |
*response_value = -1; |
if (url.is_valid() && contents) { |
- // Since we may be on the UI thread don't call GetURLRequestContext(). |
- // Get the request context specific to the current TabContents and app. |
- const Extension* installed_app = static_cast<BrowserRenderProcessHost*>( |
- contents->render_view_host()->process())->installed_app(); |
scoped_refptr<net::URLRequestContextGetter> context_getter = |
- contents->profile()->GetRequestContextForPossibleApp(installed_app); |
- |
+ GetRequestContext(contents); |
base::WaitableEvent event(true /* manual reset */, |
false /* not initially signaled */); |
bool success = false; |
@@ -164,13 +163,8 @@ |
bool* success) { |
*success = false; |
if (url.is_valid() && contents) { |
- // Since we may be on the UI thread don't call GetURLRequestContext(). |
- // Get the request context specific to the current TabContents and app. |
- const Extension* installed_app = static_cast<BrowserRenderProcessHost*>( |
- contents->render_view_host()->process())->installed_app(); |
scoped_refptr<net::URLRequestContextGetter> context_getter = |
- contents->profile()->GetRequestContextForPossibleApp(installed_app); |
- |
+ GetRequestContext(contents); |
base::WaitableEvent event(true /* manual reset */, |
false /* not initially signaled */); |
CHECK(BrowserThread::PostTask( |