summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-27 19:23:38 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-27 19:23:38 +0000
commit6205c4f2302239185dd2a93c105c18f0dd14af63 (patch)
tree9281fac0b7e3d7c1819c6b49384fb80b64dd5ab6 /chrome
parentfc0a3b6d4bbacdcf2926200e1f854ba5cc40628d (diff)
downloadchromium_src-6205c4f2302239185dd2a93c105c18f0dd14af63.zip
chromium_src-6205c4f2302239185dd2a93c105c18f0dd14af63.tar.gz
chromium_src-6205c4f2302239185dd2a93c105c18f0dd14af63.tar.bz2
Removal of Profile from content part 2.
BUG=76788 TEST=no change visible Review URL: http://codereview.chromium.org/7480028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94332 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/debugger/devtools_window.cc3
-rw-r--r--chrome/browser/extensions/extension_event_router.cc2
-rw-r--r--chrome/browser/extensions/extension_function_dispatcher.cc3
-rw-r--r--chrome/browser/extensions/extension_message_handler.cc3
-rw-r--r--chrome/browser/extensions/extension_message_service.cc6
-rw-r--r--chrome/browser/extensions/extension_process_manager.cc34
-rw-r--r--chrome/browser/extensions/extension_service.cc11
-rw-r--r--chrome/browser/extensions/extensions_ui.cc5
-rw-r--r--chrome/browser/extensions/user_script_master.cc3
-rw-r--r--chrome/browser/memory_details.cc3
-rw-r--r--chrome/browser/spellcheck_host_impl.cc3
-rw-r--r--chrome/browser/spellcheck_message_filter.cc5
-rw-r--r--chrome/browser/tab_contents/background_contents.cc22
-rw-r--r--chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm2
-rw-r--r--chrome/browser/ui/gtk/extensions/extension_popup_gtk.cc2
-rw-r--r--chrome/browser/ui/views/extensions/extension_popup.cc2
-rw-r--r--chrome/browser/visitedlink/visitedlink_event_listener.cc9
-rw-r--r--chrome/browser/visitedlink/visitedlink_unittest.cc3
18 files changed, 74 insertions, 47 deletions
diff --git a/chrome/browser/debugger/devtools_window.cc b/chrome/browser/debugger/devtools_window.cc
index eda78d8..367f7970 100644
--- a/chrome/browser/debugger/devtools_window.cc
+++ b/chrome/browser/debugger/devtools_window.cc
@@ -566,7 +566,8 @@ DevToolsWindow* DevToolsWindow::ToggleDevToolsWindow(
bool do_open = force_open;
if (!window) {
- Profile* profile = inspected_rvh->process()->profile();
+ Profile* profile = Profile::FromBrowserContext(
+ inspected_rvh->process()->browser_context());
bool docked = profile->GetPrefs()->GetBoolean(prefs::kDevToolsOpenDocked);
window = new DevToolsWindow(profile, inspected_rvh, docked, false);
manager->RegisterDevToolsClientHostFor(inspected_rvh, window);
diff --git a/chrome/browser/extensions/extension_event_router.cc b/chrome/browser/extensions/extension_event_router.cc
index 44561ce..7a9cb340 100644
--- a/chrome/browser/extensions/extension_event_router.cc
+++ b/chrome/browser/extensions/extension_event_router.cc
@@ -202,7 +202,7 @@ void ExtensionEventRouter::DispatchEventImpl(
// Is this event from a different profile than the renderer (ie, an
// incognito tab event sent to a normal process, or vice versa).
bool cross_incognito = restrict_to_profile &&
- listener->process->profile() != restrict_to_profile;
+ listener->process->browser_context() != restrict_to_profile;
const Extension* extension = service->GetExtensionById(
listener->extension_id, false);
// Send the event with different arguments to extensions that can't
diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc
index 15529b2..f90868a 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.cc
+++ b/chrome/browser/extensions/extension_function_dispatcher.cc
@@ -498,7 +498,8 @@ Browser* ExtensionFunctionDispatcher::GetCurrentBrowser(
// profile. Note that the profile may already be incognito, in which case
// we will search the incognito version only, regardless of the value of
// |include_incognito|.
- Profile* profile = render_view_host->process()->profile();
+ Profile* profile = Profile::FromBrowserContext(
+ render_view_host->process()->browser_context());
browser = BrowserList::FindTabbedBrowser(profile, include_incognito);
// NOTE(rafaelw): This can return NULL in some circumstances. In particular,
diff --git a/chrome/browser/extensions/extension_message_handler.cc b/chrome/browser/extensions/extension_message_handler.cc
index 7595082..8895530 100644
--- a/chrome/browser/extensions/extension_message_handler.cc
+++ b/chrome/browser/extensions/extension_message_handler.cc
@@ -37,7 +37,8 @@ void ExtensionMessageHandler::RenderViewHostInitialized() {
void ExtensionMessageHandler::OnPostMessage(int port_id,
const std::string& message) {
- Profile* profile = render_view_host()->process()->profile();
+ Profile* profile = Profile::FromBrowserContext(
+ render_view_host()->process()->browser_context());
if (profile->GetExtensionMessageService()) {
profile->GetExtensionMessageService()->PostMessageFromRenderer(
port_id, message);
diff --git a/chrome/browser/extensions/extension_message_service.cc b/chrome/browser/extensions/extension_message_service.cc
index 0dd960d..58400e5 100644
--- a/chrome/browser/extensions/extension_message_service.cc
+++ b/chrome/browser/extensions/extension_message_service.cc
@@ -143,12 +143,13 @@ void ExtensionMessageService::OpenChannelToExtension(
RenderProcessHost* source = RenderProcessHost::FromID(source_process_id);
if (!source)
return;
+ Profile* profile = Profile::FromBrowserContext(source->browser_context());
// Note: we use the source's profile here. If the source is an incognito
// process, we will use the incognito EPM to find the right extension process,
// which depends on whether the extension uses spanning or split mode.
MessagePort receiver(
- source->profile()->GetExtensionProcessManager()->GetExtensionProcess(
+ profile->GetExtensionProcessManager()->GetExtensionProcess(
target_extension_id),
MSG_ROUTING_CONTROL);
TabContents* source_contents = tab_util::GetTabContentsByID(
@@ -173,10 +174,11 @@ void ExtensionMessageService::OpenChannelToTab(
RenderProcessHost* source = RenderProcessHost::FromID(source_process_id);
if (!source)
return;
+ Profile* profile = Profile::FromBrowserContext(source->browser_context());
TabContentsWrapper* contents = NULL;
MessagePort receiver;
- if (ExtensionTabUtil::GetTabById(tab_id, source->profile(), true,
+ if (ExtensionTabUtil::GetTabById(tab_id, profile, true,
NULL, NULL, &contents, NULL)) {
receiver.sender = contents->render_view_host();
receiver.routing_id = contents->render_view_host()->routing_id();
diff --git a/chrome/browser/extensions/extension_process_manager.cc b/chrome/browser/extensions/extension_process_manager.cc
index 1944478..9dc02d4 100644
--- a/chrome/browser/extensions/extension_process_manager.cc
+++ b/chrome/browser/extensions/extension_process_manager.cc
@@ -132,8 +132,9 @@ ExtensionHost* ExtensionProcessManager::CreateViewHost(
const GURL& url, Browser* browser, ViewType::Type view_type) {
// A NULL browser may only be given for pop-up views.
DCHECK(browser || (!browser && view_type == ViewType::EXTENSION_POPUP));
- ExtensionService* service =
- browsing_instance_->profile()->GetExtensionService();
+ Profile* profile =
+ Profile::FromBrowserContext(browsing_instance_->browser_context());
+ ExtensionService* service = profile->GetExtensionService();
if (service) {
const Extension* extension = service->GetExtensionByURL(url);
if (extension)
@@ -198,8 +199,9 @@ void ExtensionProcessManager::OpenOptionsPage(const Extension* extension,
// Force the options page to open in non-OTR window, because it won't be
// able to save settings from OTR.
if (!browser || browser->profile()->IsOffTheRecord()) {
- browser = Browser::GetOrCreateTabbedBrowser(
- browsing_instance_->profile()->GetOriginalProfile());
+ Profile* profile =
+ Profile::FromBrowserContext(browsing_instance_->browser_context());
+ browser = Browser::GetOrCreateTabbedBrowser(profile->GetOriginalProfile());
}
browser->OpenURL(extension->options_url(), GURL(), SINGLETON_TAB,
@@ -262,8 +264,9 @@ const Extension* ExtensionProcessManager::GetExtensionForSiteInstance(
if (it != extension_ids_.end()) {
// Look up the extension by ID, including disabled extensions in case
// this gets called while an old process is still around.
- ExtensionService* service =
- browsing_instance_->profile()->GetExtensionService();
+ Profile* profile =
+ Profile::FromBrowserContext(browsing_instance_->browser_context());
+ ExtensionService* service = profile->GetExtensionService();
return service->GetExtensionById(it->second, false);
}
@@ -342,7 +345,7 @@ void ExtensionProcessManager::Observe(int type,
void ExtensionProcessManager::OnExtensionHostCreated(ExtensionHost* host,
bool is_background) {
- DCHECK_EQ(browsing_instance_->profile(), host->profile());
+ DCHECK_EQ(browsing_instance_->browser_context(), host->profile());
all_hosts_.insert(host);
if (is_background)
@@ -442,8 +445,9 @@ const Extension* IncognitoExtensionProcessManager::GetExtensionForSiteInstance(
const Extension* IncognitoExtensionProcessManager::GetExtensionOrAppByURL(
const GURL& url) {
- ExtensionService* service =
- browsing_instance_->profile()->GetExtensionService();
+ Profile* profile =
+ Profile::FromBrowserContext(browsing_instance_->browser_context());
+ ExtensionService* service = profile->GetExtensionService();
if (!service)
return NULL;
return (url.SchemeIs(chrome::kExtensionScheme)) ?
@@ -452,8 +456,9 @@ const Extension* IncognitoExtensionProcessManager::GetExtensionOrAppByURL(
bool IncognitoExtensionProcessManager::IsIncognitoEnabled(
const Extension* extension) {
- ExtensionService* service =
- browsing_instance_->profile()->GetExtensionService();
+ Profile* profile =
+ Profile::FromBrowserContext(browsing_instance_->browser_context());
+ ExtensionService* service = profile->GetExtensionService();
return service && service->IsIncognitoEnabled(extension->id());
}
@@ -467,12 +472,13 @@ void IncognitoExtensionProcessManager::Observe(
// incognito window. Watch for new browsers and create the hosts if
// it matches our profile.
Browser* browser = Source<Browser>(source).ptr();
- if (browser->profile() == browsing_instance_->profile()) {
+ if (browser->profile() == browsing_instance_->browser_context()) {
// On Chrome OS, a login screen is implemented as a browser.
// This browser has no extension service. In this case,
// service will be NULL.
- ExtensionService* service =
- browsing_instance_->profile()->GetExtensionService();
+ Profile* profile =
+ Profile::FromBrowserContext(browsing_instance_->browser_context());
+ ExtensionService* service = profile->GetExtensionService();
if (service && service->is_ready())
CreateBackgroundHosts(this, service->extensions());
}
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 72667a1..ffb87e06 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -1363,8 +1363,9 @@ void ExtensionService::NotifyExtensionLoaded(const Extension* extension) {
for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator());
!i.IsAtEnd(); i.Advance()) {
RenderProcessHost* host = i.GetCurrentValue();
- if (host->profile()->GetOriginalProfile() ==
- profile_->GetOriginalProfile()) {
+ Profile* host_profile =
+ Profile::FromBrowserContext(host->browser_context());
+ if (host_profile->GetOriginalProfile() == profile_->GetOriginalProfile()) {
host->Send(
new ExtensionMsg_Loaded(ExtensionMsg_Loaded_Params(
extension, extension->GetActivePermissions())));
@@ -1460,10 +1461,10 @@ void ExtensionService::NotifyExtensionUnloaded(
for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator());
!i.IsAtEnd(); i.Advance()) {
RenderProcessHost* host = i.GetCurrentValue();
- if (host->profile()->GetOriginalProfile() ==
- profile_->GetOriginalProfile()) {
+ Profile* host_profile =
+ Profile::FromBrowserContext(host->browser_context());
+ if (host_profile->GetOriginalProfile() == profile_->GetOriginalProfile())
host->Send(new ExtensionMsg_Unloaded(extension->id()));
- }
}
profile_->UnregisterExtensionWithRequestContexts(extension->id(), reason);
diff --git a/chrome/browser/extensions/extensions_ui.cc b/chrome/browser/extensions/extensions_ui.cc
index 8eb68c8..c10ad0d 100644
--- a/chrome/browser/extensions/extensions_ui.cc
+++ b/chrome/browser/extensions/extensions_ui.cc
@@ -757,8 +757,9 @@ void ExtensionsDOMHandler::GetActivePagesForExtensionProcess(
continue;
}
- result->push_back(ExtensionPage(url, process->id(), host->routing_id(),
- process->profile()->IsOffTheRecord()));
+ result->push_back(
+ ExtensionPage(url, process->id(), host->routing_id(),
+ process->browser_context()->IsOffTheRecord()));
}
}
diff --git a/chrome/browser/extensions/user_script_master.cc b/chrome/browser/extensions/user_script_master.cc
index 758700c..8267b78 100644
--- a/chrome/browser/extensions/user_script_master.cc
+++ b/chrome/browser/extensions/user_script_master.cc
@@ -363,8 +363,9 @@ void UserScriptMaster::StartLoad() {
void UserScriptMaster::SendUpdate(RenderProcessHost* process,
base::SharedMemory* shared_memory) {
+ Profile* profile = Profile::FromBrowserContext(process->browser_context());
// Make sure we only send user scripts to processes in our profile.
- if (!profile_->IsSameProfile(process->profile()))
+ if (!profile_->IsSameProfile(profile))
return;
// If the process is being started asynchronously, early return. We'll end up
diff --git a/chrome/browser/memory_details.cc b/chrome/browser/memory_details.cc
index 8d26788..7649775 100644
--- a/chrome/browser/memory_details.cc
+++ b/chrome/browser/memory_details.cc
@@ -135,7 +135,8 @@ void MemoryDetails::CollectChildInfoOnUIThread() {
continue;
}
process.type = ChildProcessInfo::RENDER_PROCESS;
- Profile* profile = render_process_host->profile();
+ Profile* profile =
+ Profile::FromBrowserContext(render_process_host->browser_context());
ExtensionService* extension_service = profile->GetExtensionService();
// The RenderProcessHost may host multiple TabContents. Any
diff --git a/chrome/browser/spellcheck_host_impl.cc b/chrome/browser/spellcheck_host_impl.cc
index e0f9fd2..f490e0d 100644
--- a/chrome/browser/spellcheck_host_impl.cc
+++ b/chrome/browser/spellcheck_host_impl.cc
@@ -143,7 +143,8 @@ void SpellCheckHostImpl::UnsetObserver() {
void SpellCheckHostImpl::InitForRenderer(RenderProcessHost* process) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- PrefService* prefs = process->profile()->GetPrefs();
+ Profile* profile = Profile::FromBrowserContext(process->browser_context());
+ PrefService* prefs = profile->GetPrefs();
IPC::PlatformFileForTransit file;
if (GetDictionaryFile() != base::kInvalidPlatformFileValue) {
diff --git a/chrome/browser/spellcheck_message_filter.cc b/chrome/browser/spellcheck_message_filter.cc
index 54de49e..483d560 100644
--- a/chrome/browser/spellcheck_message_filter.cc
+++ b/chrome/browser/spellcheck_message_filter.cc
@@ -94,7 +94,7 @@ void SpellCheckMessageFilter::OnSpellCheckerRequestDictionary() {
RenderProcessHost* host = RenderProcessHost::FromID(render_process_id_);
if (!host)
return; // Teardown.
- Profile* profile = host->profile();
+ Profile* profile = Profile::FromBrowserContext(host->browser_context());
// The renderer has requested that we initialize its spellchecker. This should
// generally only be called once per session, as after the first call, all
// future renderers will be passed the initialization information on startup
@@ -117,7 +117,8 @@ void SpellCheckMessageFilter::OnNotifyChecked(const string16& word,
if (!host)
return; // Teardown.
// Delegates to SpellCheckHost which tracks the stats of our spellchecker.
- SpellCheckHost* spellcheck_host = host->profile()->GetSpellCheckHost();
+ Profile* profile = Profile::FromBrowserContext(host->browser_context());
+ SpellCheckHost* spellcheck_host = profile->GetSpellCheckHost();
if (spellcheck_host && spellcheck_host->GetMetrics())
spellcheck_host->GetMetrics()->RecordCheckedWordStats(word, misspelled);
}
diff --git a/chrome/browser/tab_contents/background_contents.cc b/chrome/browser/tab_contents/background_contents.cc
index 66c20a9..0c78a80 100644
--- a/chrome/browser/tab_contents/background_contents.cc
+++ b/chrome/browser/tab_contents/background_contents.cc
@@ -52,7 +52,8 @@ BackgroundContents::BackgroundContents()
BackgroundContents::~BackgroundContents() {
if (!render_view_host_) // Will be null for unit tests.
return;
- Profile* profile = render_view_host_->process()->profile();
+ Profile* profile = Profile::FromBrowserContext(
+ render_view_host_->process()->browser_context());
NotificationService::current()->Notify(
chrome::NOTIFICATION_BACKGROUND_CONTENTS_DELETED,
Source<Profile>(profile),
@@ -92,7 +93,8 @@ void BackgroundContents::DidNavigate(
// extent a background page will be opened but will remain at about:blank.
url_ = params.url;
- Profile* profile = render_view_host->process()->profile();
+ Profile* profile = Profile::FromBrowserContext(
+ render_view_host->process()->browser_context());
NotificationService::current()->Notify(
chrome::NOTIFICATION_BACKGROUND_CONTENTS_NAVIGATED,
Source<Profile>(profile),
@@ -147,7 +149,8 @@ gfx::NativeWindow BackgroundContents::GetDialogRootWindow() {
}
void BackgroundContents::Close(RenderViewHost* render_view_host) {
- Profile* profile = render_view_host->process()->profile();
+ Profile* profile = Profile::FromBrowserContext(
+ render_view_host->process()->browser_context());
NotificationService::current()->Notify(
chrome::NOTIFICATION_BACKGROUND_CONTENTS_CLOSED,
Source<Profile>(profile),
@@ -158,7 +161,8 @@ void BackgroundContents::Close(RenderViewHost* render_view_host) {
void BackgroundContents::RenderViewGone(RenderViewHost* rvh,
base::TerminationStatus status,
int error_code) {
- Profile* profile = rvh->process()->profile();
+ Profile* profile =
+ Profile::FromBrowserContext(rvh->process()->browser_context());
NotificationService::current()->Notify(
chrome::NOTIFICATION_BACKGROUND_CONTENTS_TERMINATED,
Source<Profile>(profile),
@@ -182,7 +186,8 @@ RendererPreferences BackgroundContents::GetRendererPrefs(
WebPreferences BackgroundContents::GetWebkitPrefs() {
// TODO(rafaelw): Consider enabling the webkit_prefs.dom_paste_enabled for
// apps.
- Profile* profile = render_view_host_->process()->profile();
+ Profile* profile = Profile::FromBrowserContext(
+ render_view_host_->process()->browser_context());
return RenderViewHostDelegateHelper::GetWebkitPrefs(profile,
false); // is_web_ui
}
@@ -190,12 +195,13 @@ WebPreferences BackgroundContents::GetWebkitPrefs() {
void BackgroundContents::CreateNewWindow(
int route_id,
const ViewHostMsg_CreateWindow_Params& params) {
+ Profile* profile = Profile::FromBrowserContext(
+ render_view_host_->process()->browser_context());
delegate_view_helper_.CreateNewWindow(
route_id,
- render_view_host_->process()->profile(),
+ profile,
render_view_host_->site_instance(),
- ChromeWebUIFactory::GetInstance()->GetWebUIType(
- render_view_host_->process()->profile(), url_),
+ ChromeWebUIFactory::GetInstance()->GetWebUIType(profile, url_),
this,
params.window_container_type,
params.frame_name);
diff --git a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
index 85bee4f..d5e22c3 100644
--- a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
+++ b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
@@ -133,7 +133,7 @@ class DevtoolsNotificationBridge : public NotificationObserver {
registrar_.reset(new NotificationRegistrar);
registrar_->Add(notificationBridge_.get(),
content::NOTIFICATION_DEVTOOLS_WINDOW_CLOSING,
- Source<Profile>(host->profile()));
+ Source<content::BrowserContext>(host->profile()));
registrar_->Add(notificationBridge_.get(),
chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
Source<Profile>(host->profile()));
diff --git a/chrome/browser/ui/gtk/extensions/extension_popup_gtk.cc b/chrome/browser/ui/gtk/extensions/extension_popup_gtk.cc
index ac258d7..84393dd 100644
--- a/chrome/browser/ui/gtk/extensions/extension_popup_gtk.cc
+++ b/chrome/browser/ui/gtk/extensions/extension_popup_gtk.cc
@@ -100,7 +100,7 @@ void ExtensionPopupGtk::ShowPopup() {
DevToolsWindow::OpenDevToolsWindow(host_->render_view_host());
// Listen for the the devtools window closing.
registrar_.Add(this, content::NOTIFICATION_DEVTOOLS_WINDOW_CLOSING,
- Source<Profile>(host_->profile()));
+ Source<content::BrowserContext>(host_->profile()));
}
// Only one instance should be showing at a time. Get rid of the old one, if
diff --git a/chrome/browser/ui/views/extensions/extension_popup.cc b/chrome/browser/ui/views/extensions/extension_popup.cc
index 9d1a5ad..4a2eec9 100644
--- a/chrome/browser/ui/views/extensions/extension_popup.cc
+++ b/chrome/browser/ui/views/extensions/extension_popup.cc
@@ -129,7 +129,7 @@ void ExtensionPopup::Observe(int type,
if (inspect_with_devtools_) {
// Listen for the the devtools window closing.
registrar_.Add(this, content::NOTIFICATION_DEVTOOLS_WINDOW_CLOSING,
- Source<Profile>(extension_host_->profile()));
+ Source<content::BrowserContext>(extension_host_->profile()));
DevToolsWindow::ToggleDevToolsWindow(
extension_host_->render_view_host(),
DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE);
diff --git a/chrome/browser/visitedlink/visitedlink_event_listener.cc b/chrome/browser/visitedlink/visitedlink_event_listener.cc
index cadfedb..13461d4 100644
--- a/chrome/browser/visitedlink/visitedlink_event_listener.cc
+++ b/chrome/browser/visitedlink/visitedlink_event_listener.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -122,7 +122,8 @@ void VisitedLinkEventListener::NewTable(base::SharedMemory* table_memory) {
for (Updaters::iterator i = updaters_.begin(); i != updaters_.end(); ++i) {
// Make sure to not send to incognito renderers.
RenderProcessHost* process = RenderProcessHost::FromID(i->first);
- VisitedLinkMaster* master = process->profile()->GetVisitedLinkMaster();
+ Profile* profile = Profile::FromBrowserContext(process->browser_context());
+ VisitedLinkMaster* master = profile->GetVisitedLinkMaster();
if (master && master->shared_memory() == table_memory)
i->second->SendVisitedLinkTable(table_memory);
}
@@ -169,7 +170,9 @@ void VisitedLinkEventListener::Observe(int type,
// Initialize support for visited links. Send the renderer process its
// initial set of visited links.
- VisitedLinkMaster* master = process->profile()->GetVisitedLinkMaster();
+ Profile* profile =
+ Profile::FromBrowserContext(process->browser_context());
+ VisitedLinkMaster* master = profile->GetVisitedLinkMaster();
if (!master)
return;
diff --git a/chrome/browser/visitedlink/visitedlink_unittest.cc b/chrome/browser/visitedlink/visitedlink_unittest.cc
index 86362a1..3af5113 100644
--- a/chrome/browser/visitedlink/visitedlink_unittest.cc
+++ b/chrome/browser/visitedlink/visitedlink_unittest.cc
@@ -524,7 +524,8 @@ class VisitRelayingRenderProcessHost : public BrowserRenderProcessHost {
virtual bool Send(IPC::Message* msg) {
VisitCountingProfile* counting_profile =
- static_cast<VisitCountingProfile*>(profile());
+ static_cast<VisitCountingProfile*>(
+ Profile::FromBrowserContext(browser_context()));
if (msg->type() == ViewMsg_VisitedLink_Add::ID) {
void* iter = NULL;