diff options
author | rdevlin.cronin <rdevlin.cronin@chromium.org> | 2015-06-15 14:50:17 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-15 21:50:41 +0000 |
commit | 585b1bc5f9a8ebec84e6e74b917f58a0a9a28ecd (patch) | |
tree | c4349ddc83393b70df49e41a8a99e4e2229f0a85 /chrome/browser | |
parent | 91fa99545857ef7fe11c573c98be90bd640b5eeb (diff) | |
download | chromium_src-585b1bc5f9a8ebec84e6e74b917f58a0a9a28ecd.zip chromium_src-585b1bc5f9a8ebec84e6e74b917f58a0a9a28ecd.tar.gz chromium_src-585b1bc5f9a8ebec84e6e74b917f58a0a9a28ecd.tar.bz2 |
[Extensions OOPI] Update extension functions to use RFH pt 2
Continue updating extension functions to use RenderFrameHost instead of
RenderViewHost.
BUG=455776
Review URL: https://codereview.chromium.org/1186873003
Cr-Commit-Position: refs/heads/master@{#334467}
Diffstat (limited to 'chrome/browser')
15 files changed, 90 insertions, 101 deletions
diff --git a/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc b/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc index 58bd760..6fa89dd 100644 --- a/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc +++ b/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc @@ -9,8 +9,8 @@ #include "chrome/browser/extensions/extension_tab_util.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_switches.h" +#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" -#include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" #include "content/public/common/origin_util.h" #include "net/base/net_util.h" @@ -40,7 +40,7 @@ bool DesktopCaptureChooseDesktopMediaFunction::RunAsync() { EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &request_id_)); DesktopCaptureRequestsRegistry::GetInstance()->AddRequest( - render_view_host()->GetProcess()->GetID(), request_id_, this); + render_frame_host()->GetProcess()->GetID(), request_id_, this); args_->Remove(0, NULL); @@ -88,7 +88,7 @@ bool DesktopCaptureChooseDesktopMediaFunction::RunAsync() { } else { origin = extension()->url(); target_name = base::UTF8ToUTF16(extension()->name()); - web_contents = content::WebContents::FromRenderViewHost(render_view_host()); + web_contents = GetSenderWebContents(); DCHECK(web_contents); } diff --git a/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc b/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc index 73de92f..d20cd11 100644 --- a/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc +++ b/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc @@ -13,7 +13,6 @@ #include "chrome/browser/ui/ash/ash_util.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" -#include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" #include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h" #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" @@ -46,9 +45,9 @@ DesktopCaptureChooseDesktopMediaFunctionBase:: DesktopCaptureChooseDesktopMediaFunctionBase:: ~DesktopCaptureChooseDesktopMediaFunctionBase() { // RenderViewHost may be already destroyed. - if (render_view_host()) { + if (render_frame_host()) { DesktopCaptureRequestsRegistry::GetInstance()->RemoveRequest( - render_view_host()->GetProcess()->GetID(), request_id_); + render_frame_host()->GetProcess()->GetID(), request_id_); } } @@ -206,7 +205,7 @@ bool DesktopCaptureCancelChooseDesktopMediaFunctionBase::RunSync() { EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &request_id)); DesktopCaptureRequestsRegistry::GetInstance()->CancelRequest( - render_view_host()->GetProcess()->GetID(), request_id); + render_frame_host()->GetProcess()->GetID(), request_id); return true; } diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.cc b/chrome/browser/extensions/api/developer_private/developer_private_api.cc index 28a2fcf..2c1516a 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc @@ -44,6 +44,7 @@ #include "chrome/grit/generated_resources.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" +#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/site_instance.h" @@ -867,7 +868,7 @@ bool DeveloperPrivateLoadDirectoryFunction::RunAsync() { EXTENSION_FUNCTION_VALIDATE(args_->GetString(2, &directory_url_str)); context_ = content::BrowserContext::GetStoragePartition( - GetProfile(), render_view_host()->GetSiteInstance()) + GetProfile(), render_frame_host()->GetSiteInstance()) ->GetFileSystemContext(); // Directory url is non empty only for syncfilesystem. @@ -882,11 +883,10 @@ bool DeveloperPrivateLoadDirectoryFunction::RunAsync() { return LoadByFileSystemAPI(directory_url); } else { // Check if the DirecotryEntry is the instance of chrome filesystem. - if (!app_file_handler_util::ValidateFileEntryAndGetPath(filesystem_name, - filesystem_path, - render_view_host(), - &project_base_path_, - &error_)) { + if (!app_file_handler_util::ValidateFileEntryAndGetPath( + filesystem_name, filesystem_path, + render_frame_host()->GetProcess()->GetID(), &project_base_path_, + &error_)) { SetError("DirectoryEntry of unsupported filesystem."); return false; } diff --git a/chrome/browser/extensions/api/downloads/downloads_api.cc b/chrome/browser/extensions/api/downloads/downloads_api.cc index a89ed49..0b167f0 100644 --- a/chrome/browser/extensions/api/downloads/downloads_api.cc +++ b/chrome/browser/extensions/api/downloads/downloads_api.cc @@ -55,6 +55,7 @@ #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_source.h" +#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/render_widget_host_view.h" @@ -954,8 +955,7 @@ bool DownloadsDownloadFunction::RunAsync() { scoped_ptr<content::DownloadUrlParameters> download_params( new content::DownloadUrlParameters( - download_url, - render_view_host()->GetProcess()->GetID(), + download_url, render_frame_host()->GetProcess()->GetID(), render_view_host()->GetRoutingID(), current_profile->GetResourceContext())); diff --git a/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc b/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc index 74a13478..0721411 100644 --- a/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc +++ b/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc @@ -9,7 +9,6 @@ #include "base/files/file_util.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/child_process_security_policy.h" -#include "content/public/browser/render_process_host.h" #include "extensions/browser/extension_prefs.h" #include "extensions/browser/granted_file_entry.h" #include "extensions/common/permissions/permissions_data.h" @@ -316,12 +315,11 @@ bool HasFileSystemWritePermission(const Extension* extension) { APIPermission::kFileSystemWrite); } -bool ValidateFileEntryAndGetPath( - const std::string& filesystem_name, - const std::string& filesystem_path, - const content::RenderViewHost* render_view_host, - base::FilePath* file_path, - std::string* error) { +bool ValidateFileEntryAndGetPath(const std::string& filesystem_name, + const std::string& filesystem_path, + int render_process_id, + base::FilePath* file_path, + std::string* error) { if (filesystem_path.empty()) { *error = kInvalidParameters; return false; @@ -337,8 +335,7 @@ bool ValidateFileEntryAndGetPath( // filesystem. content::ChildProcessSecurityPolicy* policy = content::ChildProcessSecurityPolicy::GetInstance(); - if (!policy->CanReadFileSystem(render_view_host->GetProcess()->GetID(), - filesystem_id)) { + if (!policy->CanReadFileSystem(render_process_id, filesystem_id)) { *error = kSecurityError; return false; } diff --git a/chrome/browser/extensions/api/file_handlers/app_file_handler_util.h b/chrome/browser/extensions/api/file_handlers/app_file_handler_util.h index e39d941..3ca6f6a 100644 --- a/chrome/browser/extensions/api/file_handlers/app_file_handler_util.h +++ b/chrome/browser/extensions/api/file_handlers/app_file_handler_util.h @@ -10,7 +10,7 @@ #include <utility> #include <vector> -#include "content/public/browser/render_view_host.h" +#include "base/callback.h" #include "extensions/common/extension.h" #include "extensions/common/manifest_handlers/file_handler_info.h" @@ -19,6 +19,7 @@ class Profile; namespace extensions { class ExtensionPrefs; +struct FileHandlerInfo; struct GrantedFileEntry; // TODO(benwells): move this to platform_apps namespace. @@ -78,12 +79,11 @@ bool HasFileSystemWritePermission(const Extension* extension); // Validates a file entry and populates |file_path| with the absolute path if it // is valid. -bool ValidateFileEntryAndGetPath( - const std::string& filesystem_name, - const std::string& filesystem_path, - const content::RenderViewHost* render_view_host, - base::FilePath* file_path, - std::string* error); +bool ValidateFileEntryAndGetPath(const std::string& filesystem_name, + const std::string& filesystem_path, + int render_process_id, + base::FilePath* file_path, + std::string* error); } // namespace app_file_handler_util diff --git a/chrome/browser/extensions/api/file_system/file_system_api.cc b/chrome/browser/extensions/api/file_system/file_system_api.cc index bbd3357..99dd640 100644 --- a/chrome/browser/extensions/api/file_system/file_system_api.cc +++ b/chrome/browser/extensions/api/file_system/file_system_api.cc @@ -35,7 +35,6 @@ #include "content/public/browser/child_process_security_policy.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" -#include "content/public/browser/render_view_host.h" #include "content/public/browser/storage_partition.h" #include "content/public/browser/web_contents.h" #include "extensions/browser/app_window/app_window.h" @@ -226,16 +225,18 @@ void PassFileInfoToUIThread(const FileInfoOptCallback& callback, } // Gets a WebContents instance handle for a platform app hosted in -// |render_view_host|. If not found, then returns NULL. -content::WebContents* GetWebContentsForRenderViewHost( +// |render_frame_host|. If not found, then returns NULL. +content::WebContents* GetWebContentsForRenderFrameHost( Profile* profile, - content::RenderViewHost* render_view_host) { - extensions::AppWindowRegistry* const registry = - extensions::AppWindowRegistry::Get(profile); - DCHECK(registry); - extensions::AppWindow* const app_window = - registry->GetAppWindowForRenderViewHost(render_view_host); - return app_window ? app_window->web_contents() : nullptr; + content::RenderFrameHost* render_frame_host) { + content::WebContents* web_contents = + content::WebContents::FromRenderFrameHost(render_frame_host); + // Check if there is an app window associated with the web contents; if not, + // return null. + return extensions::AppWindowRegistry::Get(profile) + ->GetAppWindowForWebContents(web_contents) + ? web_contents + : nullptr; } #if defined(OS_CHROMEOS) @@ -407,7 +408,7 @@ void ConsentProvider::DialogResultToConsent(const ConsentCallback& callback, } ConsentProviderDelegate::ConsentProviderDelegate(Profile* profile, - content::RenderViewHost* host) + content::RenderFrameHost* host) : profile_(profile), host_(host) { DCHECK(profile_); } @@ -428,7 +429,7 @@ void ConsentProviderDelegate::ShowDialog( const file_system_api::ConsentProvider::ShowDialogCallback& callback) { DCHECK(host_); content::WebContents* const foreground_contents = - GetWebContentsForRenderViewHost(profile_, host_); + GetWebContentsForRenderFrameHost(profile_, host_); // If there is no web contents handle, then the method is most probably // executed from a background page. Find an app window to host the dialog. content::WebContents* const web_contents = @@ -492,11 +493,9 @@ bool FileSystemGetDisplayPathFunction::RunSync() { EXTENSION_FUNCTION_VALIDATE(args_->GetString(1, &filesystem_path)); base::FilePath file_path; - if (!app_file_handler_util::ValidateFileEntryAndGetPath(filesystem_name, - filesystem_path, - render_view_host(), - &file_path, - &error_)) + if (!app_file_handler_util::ValidateFileEntryAndGetPath( + filesystem_name, filesystem_path, + render_frame_host()->GetProcess()->GetID(), &file_path, &error_)) return false; file_path = path_util::PrettifyPath(file_path); @@ -525,7 +524,7 @@ void FileSystemEntryFunction::PrepareFilesForWritableApp( void FileSystemEntryFunction::RegisterFileSystemsAndSendResponse( const std::vector<base::FilePath>& paths) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - if (!render_view_host()) + if (!render_frame_host()) return; CreateResponse(); @@ -589,11 +588,9 @@ bool FileSystemGetWritableEntryFunction::RunAsync() { return false; } - if (!app_file_handler_util::ValidateFileEntryAndGetPath(filesystem_name, - filesystem_path, - render_view_host(), - &path_, - &error_)) + if (!app_file_handler_util::ValidateFileEntryAndGetPath( + filesystem_name, filesystem_path, + render_frame_host()->GetProcess()->GetID(), &path_, &error_)) return false; content::BrowserThread::PostTaskAndReply( @@ -774,7 +771,7 @@ void FileSystemChooseEntryFunction::ShowPicker( // platform-app only. content::WebContents* const web_contents = extension_->is_platform_app() - ? GetWebContentsForRenderViewHost(GetProfile(), render_view_host()) + ? GetWebContentsForRenderFrameHost(GetProfile(), render_frame_host()) : GetAssociatedWebContents(); if (!web_contents) { error_ = kInvalidCallingPage; @@ -890,7 +887,7 @@ void FileSystemChooseEntryFunction::FilesSelected( // Get the WebContents for the app window to be the parent window of the // confirmation dialog if necessary. content::WebContents* const web_contents = - GetWebContentsForRenderViewHost(GetProfile(), render_view_host()); + GetWebContentsForRenderFrameHost(GetProfile(), render_frame_host()); if (!web_contents) { error_ = kInvalidCallingPage; SendResponse(false); @@ -1137,11 +1134,9 @@ bool FileSystemRetainEntryFunction::RunAsync() { base::FilePath path; EXTENSION_FUNCTION_VALIDATE(args_->GetString(1, &filesystem_name)); EXTENSION_FUNCTION_VALIDATE(args_->GetString(2, &filesystem_path)); - if (!app_file_handler_util::ValidateFileEntryAndGetPath(filesystem_name, - filesystem_path, - render_view_host(), - &path, - &error_)) { + if (!app_file_handler_util::ValidateFileEntryAndGetPath( + filesystem_name, filesystem_path, + render_frame_host()->GetProcess()->GetID(), &path, &error_)) { return false; } @@ -1283,7 +1278,7 @@ ExtensionFunction::ResponseAction FileSystemRequestFileSystemFunction::Run() { // Only kiosk apps in kiosk sessions can use this API. // Additionally it is enabled for whitelisted component extensions and apps. file_system_api::ConsentProviderDelegate consent_provider_delegate( - chrome_details_.GetProfile(), render_view_host()); + chrome_details_.GetProfile(), render_frame_host()); file_system_api::ConsentProvider consent_provider(&consent_provider_delegate); if (!consent_provider.IsGrantable(*extension())) @@ -1406,23 +1401,23 @@ void FileSystemRequestFileSystemFunction::OnConsentReceived( DCHECK(policy); // Read-only permisisons. - policy->GrantReadFile(render_view_host()->GetProcess()->GetID(), + policy->GrantReadFile(render_frame_host()->GetProcess()->GetID(), volume->mount_path()); - policy->GrantReadFileSystem(render_view_host()->GetProcess()->GetID(), + policy->GrantReadFileSystem(render_frame_host()->GetProcess()->GetID(), file_system_id); // Additional write permissions. if (writable) { - policy->GrantCreateReadWriteFile(render_view_host()->GetProcess()->GetID(), + policy->GrantCreateReadWriteFile(render_frame_host()->GetProcess()->GetID(), volume->mount_path()); - policy->GrantCopyInto(render_view_host()->GetProcess()->GetID(), + policy->GrantCopyInto(render_frame_host()->GetProcess()->GetID(), volume->mount_path()); - policy->GrantWriteFileSystem(render_view_host()->GetProcess()->GetID(), + policy->GrantWriteFileSystem(render_frame_host()->GetProcess()->GetID(), file_system_id); - policy->GrantDeleteFromFileSystem(render_view_host()->GetProcess()->GetID(), - file_system_id); + policy->GrantDeleteFromFileSystem( + render_frame_host()->GetProcess()->GetID(), file_system_id); policy->GrantCreateFileForFileSystem( - render_view_host()->GetProcess()->GetID(), file_system_id); + render_frame_host()->GetProcess()->GetID(), file_system_id); } base::DictionaryValue* const dict = new base::DictionaryValue(); @@ -1444,7 +1439,7 @@ ExtensionFunction::ResponseAction FileSystemGetVolumeListFunction::Run() { // Only kiosk apps in kiosk sessions can use this API. // Additionally it is enabled for whitelisted component extensions and apps. file_system_api::ConsentProviderDelegate consent_provider_delegate( - chrome_details_.GetProfile(), render_view_host()); + chrome_details_.GetProfile(), render_frame_host()); file_system_api::ConsentProvider consent_provider(&consent_provider_delegate); if (!consent_provider.IsGrantable(*extension())) diff --git a/chrome/browser/extensions/api/file_system/file_system_api.h b/chrome/browser/extensions/api/file_system/file_system_api.h index 8d1a2d2..2f8d446 100644 --- a/chrome/browser/extensions/api/file_system/file_system_api.h +++ b/chrome/browser/extensions/api/file_system/file_system_api.h @@ -112,7 +112,7 @@ class ConsentProvider { // context of running extensions) for ConsentProvider. class ConsentProviderDelegate : public ConsentProvider::DelegateInterface { public: - ConsentProviderDelegate(Profile* profile, content::RenderViewHost* host); + ConsentProviderDelegate(Profile* profile, content::RenderFrameHost* host); ~ConsentProviderDelegate(); private: @@ -135,7 +135,7 @@ class ConsentProviderDelegate : public ConsentProvider::DelegateInterface { bool IsWhitelistedComponent(const extensions::Extension& extension) override; Profile* const profile_; - content::RenderViewHost* const host_; + content::RenderFrameHost* const host_; DISALLOW_COPY_AND_ASSIGN(ConsentProviderDelegate); }; diff --git a/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc b/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc index 54453c5..5afa7be 100644 --- a/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc +++ b/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc @@ -8,6 +8,8 @@ #include "chrome/browser/extensions/api/image_writer_private/image_writer_private_api.h" #include "chrome/browser/extensions/api/image_writer_private/operation_manager.h" #include "chrome/browser/profiles/profile.h" +#include "content/public/browser/render_frame_host.h" +#include "content/public/browser/render_process_host.h" namespace image_writer_api = extensions::api::image_writer_private; @@ -77,11 +79,8 @@ bool ImageWriterPrivateWriteFromFileFunction::RunAsync() { base::FilePath path; if (!extensions::app_file_handler_util::ValidateFileEntryAndGetPath( - filesystem_name, - filesystem_path, - render_view_host(), - &path, - &error_)) + filesystem_name, filesystem_path, + render_frame_host()->GetProcess()->GetID(), &path, &error_)) return false; image_writer::OperationManager::Get(GetProfile())->StartWriteFromFile( diff --git a/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc b/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc index c73450c..ffe1dc08 100644 --- a/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc +++ b/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc @@ -8,6 +8,7 @@ #include <vector> #include "base/command_line.h" +#include "base/files/file_util.h" #include "base/json/json_writer.h" #include "base/lazy_instance.h" #include "base/logging.h" diff --git a/chrome/browser/extensions/api/page_capture/page_capture_api.cc b/chrome/browser/extensions/api/page_capture/page_capture_api.cc index e0f6b3d..672c295 100644 --- a/chrome/browser/extensions/api/page_capture/page_capture_api.cc +++ b/chrome/browser/extensions/api/page_capture/page_capture_api.cc @@ -15,8 +15,8 @@ #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" +#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" -#include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" #include "extensions/common/extension_messages.h" @@ -165,12 +165,12 @@ void PageCaptureSaveAsMHTMLFunction::ReturnSuccess(int64 file_size) { DCHECK_CURRENTLY_ON(BrowserThread::UI); WebContents* web_contents = GetWebContents(); - if (!web_contents || !render_view_host()) { + if (!web_contents || !render_frame_host()) { ReturnFailure(kTabClosedError); return; } - int child_id = render_view_host()->GetProcess()->GetID(); + int child_id = render_frame_host()->GetProcess()->GetID(); ChildProcessSecurityPolicy::GetInstance()->GrantReadFile( child_id, mhtml_path_); diff --git a/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc b/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc index 3c6a294..0b9aafc 100644 --- a/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc +++ b/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc @@ -18,7 +18,7 @@ #include "chrome/browser/sync_file_system/sync_file_system_service_factory.h" #include "chrome/common/extensions/api/sync_file_system.h" #include "content/public/browser/browser_context.h" -#include "content/public/browser/render_view_host.h" +#include "content/public/browser/render_frame_host.h" #include "content/public/browser/storage_partition.h" #include "content/public/common/content_client.h" #include "storage/browser/fileapi/file_system_context.h" @@ -71,8 +71,8 @@ bool SyncFileSystemDeleteFileSystemFunction::RunAsync() { EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &url)); scoped_refptr<storage::FileSystemContext> file_system_context = - BrowserContext::GetStoragePartition(GetProfile(), - render_view_host()->GetSiteInstance()) + BrowserContext::GetStoragePartition( + GetProfile(), render_frame_host()->GetSiteInstance()) ->GetFileSystemContext(); storage::FileSystemURL file_system_url( file_system_context->CrackURL(GURL(url))); @@ -136,9 +136,9 @@ bool SyncFileSystemRequestFileSystemFunction::RunAsync() { storage::FileSystemContext* SyncFileSystemRequestFileSystemFunction::GetFileSystemContext() { - DCHECK(render_view_host()); + DCHECK(render_frame_host()); return BrowserContext::GetStoragePartition( - GetProfile(), render_view_host()->GetSiteInstance()) + GetProfile(), render_frame_host()->GetSiteInstance()) ->GetFileSystemContext(); } @@ -175,8 +175,8 @@ bool SyncFileSystemGetFileStatusFunction::RunAsync() { EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &url)); scoped_refptr<storage::FileSystemContext> file_system_context = - BrowserContext::GetStoragePartition(GetProfile(), - render_view_host()->GetSiteInstance()) + BrowserContext::GetStoragePartition( + GetProfile(), render_frame_host()->GetSiteInstance()) ->GetFileSystemContext(); storage::FileSystemURL file_system_url( file_system_context->CrackURL(GURL(url))); @@ -220,8 +220,8 @@ bool SyncFileSystemGetFileStatusesFunction::RunAsync() { EXTENSION_FUNCTION_VALIDATE(args_->GetList(0, &file_entry_urls)); scoped_refptr<storage::FileSystemContext> file_system_context = - BrowserContext::GetStoragePartition(GetProfile(), - render_view_host()->GetSiteInstance()) + BrowserContext::GetStoragePartition( + GetProfile(), render_frame_host()->GetSiteInstance()) ->GetFileSystemContext(); // Map each file path->SyncFileStatus in the callback map. @@ -299,15 +299,15 @@ bool SyncFileSystemGetUsageAndQuotaFunction::RunAsync() { EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &url)); scoped_refptr<storage::FileSystemContext> file_system_context = - BrowserContext::GetStoragePartition(GetProfile(), - render_view_host()->GetSiteInstance()) + BrowserContext::GetStoragePartition( + GetProfile(), render_frame_host()->GetSiteInstance()) ->GetFileSystemContext(); storage::FileSystemURL file_system_url( file_system_context->CrackURL(GURL(url))); scoped_refptr<storage::QuotaManager> quota_manager = - BrowserContext::GetStoragePartition(GetProfile(), - render_view_host()->GetSiteInstance()) + BrowserContext::GetStoragePartition( + GetProfile(), render_frame_host()->GetSiteInstance()) ->GetQuotaManager(); BrowserThread::PostTask( diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc index 828f6fd7..2b51226 100644 --- a/chrome/browser/extensions/api/tabs/tabs_api.cc +++ b/chrome/browser/extensions/api/tabs/tabs_api.cc @@ -62,7 +62,6 @@ #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/render_process_host.h" -#include "content/public/browser/render_view_host.h" #include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/web_contents.h" #include "content/public/common/url_constants.h" @@ -1072,8 +1071,7 @@ bool TabsGetCurrentFunction::RunSync() { // Return the caller, if it's a tab. If not the result isn't an error but an // empty tab (hence returning true). - WebContents* caller_contents = - WebContents::FromRenderViewHost(render_view_host()); + WebContents* caller_contents = GetSenderWebContents(); if (caller_contents && ExtensionTabUtil::GetTabId(caller_contents) >= 0) SetResult(ExtensionTabUtil::CreateTabValue(caller_contents, extension())); diff --git a/chrome/browser/extensions/api/webrtc_desktop_capture_private/webrtc_desktop_capture_private_api.cc b/chrome/browser/extensions/api/webrtc_desktop_capture_private/webrtc_desktop_capture_private_api.cc index bea55a9..02439b2 100644 --- a/chrome/browser/extensions/api/webrtc_desktop_capture_private/webrtc_desktop_capture_private_api.cc +++ b/chrome/browser/extensions/api/webrtc_desktop_capture_private/webrtc_desktop_capture_private_api.cc @@ -46,7 +46,7 @@ bool WebrtcDesktopCapturePrivateChooseDesktopMediaFunction::RunAsync() { EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &request_id_)); DesktopCaptureRequestsRegistry::GetInstance()->AddRequest( - render_view_host()->GetProcess()->GetID(), request_id_, this); + render_frame_host()->GetProcess()->GetID(), request_id_, this); args_->Remove(0, NULL); diff --git a/chrome/browser/extensions/chrome_extension_function_details.cc b/chrome/browser/extensions/chrome_extension_function_details.cc index 614511f..922c96b 100644 --- a/chrome/browser/extensions/chrome_extension_function_details.cc +++ b/chrome/browser/extensions/chrome_extension_function_details.cc @@ -10,8 +10,8 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" +#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" -#include "content/public/browser/render_view_host.h" #include "extensions/browser/extension_function.h" #include "extensions/browser/extension_function_dispatcher.h" @@ -69,9 +69,9 @@ Browser* ChromeExtensionFunctionDetails::GetCurrentBrowser() const { // |include_incognito|. Look only for browsers on the active desktop as it is // preferable to pretend no browser is open then to return a browser on // another desktop. - if (function_->render_view_host()) { + if (function_->render_frame_host()) { Profile* profile = Profile::FromBrowserContext( - function_->render_view_host()->GetProcess()->GetBrowserContext()); + function_->render_frame_host()->GetProcess()->GetBrowserContext()); Browser* browser = chrome::FindAnyBrowser( profile, function_->include_incognito(), chrome::GetActiveDesktop()); if (browser) |