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

Unified Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 10823086: Make plugins work in a RenderViewTest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated according to jam@ Created 8 years, 5 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
Index: content/renderer/renderer_webkitplatformsupport_impl.cc
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc
index 6ef60cc3f446da3477e212e0d16c178375e48950..21c70a81e0107c3047133bca1b1bab7a870ca525 100644
--- a/content/renderer/renderer_webkitplatformsupport_impl.cc
+++ b/content/renderer/renderer_webkitplatformsupport_impl.cc
@@ -167,6 +167,7 @@ RendererWebKitPlatformSupportImpl::RendererWebKitPlatformSupportImpl()
clipboard_(new webkit_glue::WebClipboardImpl(clipboard_client_.get())),
mime_registry_(new RendererWebKitPlatformSupportImpl::MimeRegistry),
sudden_termination_disables_(0),
+ plugin_refresh_allowed_(true),
shared_worker_repository_(new WebSharedWorkerRepositoryImpl) {
if (g_sandbox_enabled) {
sandbox_support_.reset(
@@ -184,7 +185,7 @@ RendererWebKitPlatformSupportImpl::~RendererWebKitPlatformSupportImpl() {
namespace {
bool SendSyncMessageFromAnyThreadInternal(IPC::SyncMessage* msg) {
- RenderThreadImpl* render_thread = RenderThreadImpl::current();
+ content::RenderThread* render_thread = content::RenderThread::Get();
jam 2012/07/31 20:05:07 nit: just do a "using content::RenderThread" at th
Fady Samuel 2012/07/31 20:20:59 Done.
if (render_thread)
return render_thread->Send(msg);
scoped_refptr<IPC::SyncMessageFilter> sync_msg_filter(
@@ -296,12 +297,12 @@ void RendererWebKitPlatformSupportImpl::cacheMetadata(
// browser may cache it and return it on subsequent responses to speed
// the processing of this resource.
std::vector<char> copy(data, data + size);
- RenderThreadImpl::current()->Send(
+ content::RenderThread::Get()->Send(
new ViewHostMsg_DidGenerateCacheableMetadata(url, response_time, copy));
}
WebString RendererWebKitPlatformSupportImpl::defaultLocale() {
- return ASCIIToUTF16(RenderThreadImpl::Get()->GetLocale());
+ return ASCIIToUTF16(content::RenderThread::Get()->GetLocale());
}
void RendererWebKitPlatformSupportImpl::suddenTerminationChanged(bool enabled) {
@@ -319,7 +320,7 @@ void RendererWebKitPlatformSupportImpl::suddenTerminationChanged(bool enabled) {
return;
}
- RenderThreadImpl* thread = RenderThreadImpl::current();
+ content::RenderThread* thread = content::RenderThread::Get();
if (thread) // NULL in unittests.
thread->Send(new ViewHostMsg_SuddenTerminationChanged(enabled));
}
@@ -385,7 +386,7 @@ RendererWebKitPlatformSupportImpl::MimeRegistry::mimeTypeForExtension(
// The sandbox restricts our access to the registry, so we need to proxy
// these calls over to the browser process.
std::string mime_type;
- RenderThreadImpl::current()->Send(
+ content::RenderThread::Get()->Send(
new MimeRegistryMsg_GetMimeTypeFromExtension(
webkit_glue::WebStringToFilePathString(file_extension), &mime_type));
return ASCIIToUTF16(mime_type);
@@ -400,7 +401,7 @@ WebString RendererWebKitPlatformSupportImpl::MimeRegistry::mimeTypeFromFile(
// The sandbox restricts our access to the registry, so we need to proxy
// these calls over to the browser process.
std::string mime_type;
- RenderThreadImpl::current()->Send(new MimeRegistryMsg_GetMimeTypeFromFile(
+ content::RenderThread::Get()->Send(new MimeRegistryMsg_GetMimeTypeFromFile(
FilePath(webkit_glue::WebStringToFilePathString(file_path)),
&mime_type));
return ASCIIToUTF16(mime_type);
@@ -416,7 +417,7 @@ RendererWebKitPlatformSupportImpl::MimeRegistry::preferredExtensionForMIMEType(
// The sandbox restricts our access to the registry, so we need to proxy
// these calls over to the browser process.
FilePath::StringType file_extension;
- RenderThreadImpl::current()->Send(
+ content::RenderThread::Get()->Send(
new MimeRegistryMsg_GetPreferredExtensionForMimeType(
UTF16ToASCII(mime_type), &file_extension));
return webkit_glue::FilePathStringToWebString(file_extension);
@@ -456,7 +457,7 @@ bool RendererWebKitPlatformSupportImpl::SandboxSupport::ensureFontLoaded(
HFONT font) {
LOGFONT logfont;
GetObject(font, sizeof(LOGFONT), &logfont);
- RenderThreadImpl::current()->PreCacheFont(logfont);
+ content::RenderThread::Get()->PreCacheFont(logfont);
return true;
}
@@ -467,7 +468,7 @@ bool RendererWebKitPlatformSupportImpl::SandboxSupport::loadFont(
uint32 font_data_size;
FontDescriptor src_font_descriptor(src_font);
base::SharedMemoryHandle font_data;
- if (!RenderThreadImpl::current()->Send(new ViewHostMsg_LoadFont(
+ if (!content::RenderThread::Get()->Send(new ViewHostMsg_LoadFont(
src_font_descriptor, &font_data_size, &font_data, font_id))) {
*out = NULL;
*font_id = 0;
@@ -648,7 +649,7 @@ RendererWebKitPlatformSupportImpl::signedPublicKeyAndChallengeString(
const WebKit::WebString& challenge,
const WebKit::WebURL& url) {
std::string signed_public_key;
- RenderThreadImpl::current()->Send(new ViewHostMsg_Keygen(
+ content::RenderThread::Get()->Send(new ViewHostMsg_Keygen(
static_cast<uint32>(key_size_index),
challenge.utf8(),
GURL(url),
@@ -661,7 +662,7 @@ RendererWebKitPlatformSupportImpl::signedPublicKeyAndChallengeString(
void RendererWebKitPlatformSupportImpl::screenColorProfile(
WebVector<char>* to_profile) {
std::vector<char> profile;
- RenderThreadImpl::current()->Send(
+ content::RenderThread::Get()->Send(
new ViewHostMsg_GetMonitorColorProfile(&profile));
*to_profile = profile;
}
@@ -691,9 +692,9 @@ WebKit::WebString RendererWebKitPlatformSupportImpl::userAgent(
void RendererWebKitPlatformSupportImpl::GetPlugins(
bool refresh, std::vector<webkit::WebPluginInfo>* plugins) {
- if (!RenderThreadImpl::current()->plugin_refresh_allowed())
+ if (!plugin_refresh_allowed())
refresh = false;
- RenderThreadImpl::current()->Send(
+ content::RenderThread::Get()->Send(
new ViewHostMsg_GetPlugins(refresh, plugins));
}

Powered by Google App Engine
This is Rietveld 408576698