Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Unified Diff: chrome/browser/automation/automation_util.cc

Issue 6880089: Don't hold the installed app in BrowserProcessRenderHost, since that's in content layer now. Ext... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix browser tests Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/automation/automation_util.cc
===================================================================
--- chrome/browser/automation/automation_util.cc (revision 82593)
+++ 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,21 @@
return browser->GetTabContentsAt(tab_index);
}
+net::URLRequestContextGetter* GetRequestContext(TabContents* contents) {
+ // 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()->GetRequestContextForRenderProcess(
+ 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 +140,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 +162,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(
« no previous file with comments | « no previous file | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698