summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/browser/DEPS2
-rw-r--r--content/browser/content_browser_client.cc13
-rw-r--r--content/browser/content_browser_client.h9
-rw-r--r--content/browser/plugin_service_browsertest.cc1
-rw-r--r--content/browser/renderer_host/browser_render_process_host.cc23
-rw-r--r--content/browser/renderer_host/browser_render_process_host.h1
-rw-r--r--content/browser/renderer_host/clipboard_message_filter.cc5
-rw-r--r--content/browser/renderer_host/mock_render_process_host.cc7
-rw-r--r--content/browser/renderer_host/mock_render_process_host.h2
-rw-r--r--content/browser/renderer_host/render_message_filter.cc4
-rw-r--r--content/browser/renderer_host/render_process_host.h11
-rw-r--r--content/browser/renderer_host/render_widget_host_unittest.cc4
-rw-r--r--content/browser/tab_contents/interstitial_page.cc9
-rw-r--r--content/browser/utility_process_host.cc12
-rw-r--r--content/common/content_switches.cc5
-rw-r--r--content/common/content_switches.h1
16 files changed, 52 insertions, 57 deletions
diff --git a/content/browser/DEPS b/content/browser/DEPS
index e9116a1..a6aeb84 100644
--- a/content/browser/DEPS
+++ b/content/browser/DEPS
@@ -6,8 +6,6 @@ include_rules = [
"+chrome/browser/accessibility/browser_accessibility_state.h",
- "+chrome/browser/browser_process.h",
-
"+chrome/browser/browser_url_handler.h",
# http://crbug.com/84078
diff --git a/content/browser/content_browser_client.cc b/content/browser/content_browser_client.cc
index f3b9d94..55be667 100644
--- a/content/browser/content_browser_client.cc
+++ b/content/browser/content_browser_client.cc
@@ -5,9 +5,11 @@
#include "content/browser/content_browser_client.h"
#include "base/memory/singleton.h"
+#include "content/browser/renderer_host/resource_dispatcher_host.h"
#include "content/browser/ssl/ssl_client_auth_handler.h"
#include "content/browser/webui/empty_web_ui_factory.h"
#include "googleurl/src/gurl.h"
+#include "ui/base/clipboard/clipboard.h"
namespace content {
@@ -149,6 +151,17 @@ std::string ContentBrowserClient::GetWorkerProcessTitle(
return std::string();
}
+ResourceDispatcherHost* ContentBrowserClient::GetResourceDispatcherHost() {
+ static ResourceQueue::DelegateSet temp;
+ static ResourceDispatcherHost rdh(temp);
+ return &rdh;
+}
+
+ui::Clipboard* ContentBrowserClient::GetClipboard() {
+ static ui::Clipboard clipboard;
+ return &clipboard;
+}
+
#if defined(OS_POSIX) && !defined(OS_MACOSX)
int ContentBrowserClient::GetCrashSignalFD(const std::string& process_type) {
return -1;
diff --git a/content/browser/content_browser_client.h b/content/browser/content_browser_client.h
index 4d1220a..6149d15 100644
--- a/content/browser/content_browser_client.h
+++ b/content/browser/content_browser_client.h
@@ -21,6 +21,7 @@ class PluginProcessHost;
class Profile;
class QuotaPermissionContext;
class RenderViewHost;
+class ResourceDispatcherHost;
class SSLCertErrorHandler;
class SSLClientAuthHandler;
class TabContents;
@@ -34,6 +35,10 @@ class URLRequest;
class X509Certificate;
}
+namespace ui {
+class Clipboard;
+}
+
namespace content {
class ResourceContext;
@@ -186,6 +191,10 @@ class ContentBrowserClient {
virtual std::string GetWorkerProcessTitle(
const GURL& url, const content::ResourceContext& context);
+ // Getters for common objects.
+ virtual ResourceDispatcherHost* GetResourceDispatcherHost();
+ virtual ui::Clipboard* GetClipboard();
+
#if defined(OS_POSIX) && !defined(OS_MACOSX)
// Can return an optional fd for crash handling, otherwise returns -1.
virtual int GetCrashSignalFD(const std::string& process_type);
diff --git a/content/browser/plugin_service_browsertest.cc b/content/browser/plugin_service_browsertest.cc
index 54b6491..740b85f 100644
--- a/content/browser/plugin_service_browsertest.cc
+++ b/content/browser/plugin_service_browsertest.cc
@@ -6,7 +6,6 @@
#include "base/command_line.h"
#include "base/path_service.h"
-#include "chrome/browser/browser_process.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/in_process_browser_test.h"
diff --git a/content/browser/renderer_host/browser_render_process_host.cc b/content/browser/renderer_host/browser_render_process_host.cc
index a05160b..8416d4b 100644
--- a/content/browser/renderer_host/browser_render_process_host.cc
+++ b/content/browser/renderer_host/browser_render_process_host.cc
@@ -26,7 +26,6 @@
#include "base/string_util.h"
#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
-#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
@@ -274,14 +273,9 @@ bool BrowserRenderProcessHost::Init(bool is_accessibility_enabled) {
// Setup the IPC channel.
const std::string channel_id =
ChildProcessInfo::GenerateRandomChannelID(this);
- channel_.reset(new IPC::SyncChannel(
+ channel_.reset(new IPC::ChannelProxy(
channel_id, IPC::Channel::MODE_SERVER, this,
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), true,
- g_browser_process->shutdown_event()));
- // As a preventive mesure, we DCHECK if someone sends a synchronous message
- // with no time-out, which in the context of the browser process we should not
- // be doing.
- channel_->set_sync_messages_with_no_timeout_allowed(false);
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)));
// Call the embedder first so that their IPC filters have priority.
content::GetContentClient()->browser()->BrowserRenderProcessHostCreated(this);
@@ -353,7 +347,7 @@ void BrowserRenderProcessHost::CreateMessageFilters() {
id(), ChildProcessInfo::RENDER_PROCESS,
&profile()->GetResourceContext(),
new RendererURLRequestContextSelector(profile(), id()),
- g_browser_process->resource_dispatcher_host());
+ content::GetContentClient()->browser()->GetResourceDispatcherHost());
channel_->AddFilter(resource_message_filter);
channel_->AddFilter(new AudioInputRendererHost());
@@ -393,7 +387,7 @@ void BrowserRenderProcessHost::CreateMessageFilters() {
new WorkerMessageFilter(
id(),
&profile()->GetResourceContext(),
- g_browser_process->resource_dispatcher_host(),
+ content::GetContentClient()->browser()->GetResourceDispatcherHost(),
NewCallbackWithReturnValue(
widget_helper_.get(), &RenderWidgetHelper::GetNextRoutingID)));
@@ -694,15 +688,6 @@ bool BrowserRenderProcessHost::FastShutdownIfPossible() {
return true;
}
-bool BrowserRenderProcessHost::SendWithTimeout(IPC::Message* msg,
- int timeout_ms) {
- if (!channel_.get()) {
- delete msg;
- return false;
- }
- return channel_->SendWithTimeout(msg, timeout_ms);
-}
-
// This is a platform specific function for mapping a transport DIB given its id
TransportDIB* BrowserRenderProcessHost::MapTransportDIB(
TransportDIB::Id dib_id) {
diff --git a/content/browser/renderer_host/browser_render_process_host.h b/content/browser/renderer_host/browser_render_process_host.h
index 2584ef8..4124e4c 100644
--- a/content/browser/renderer_host/browser_render_process_host.h
+++ b/content/browser/renderer_host/browser_render_process_host.h
@@ -58,7 +58,6 @@ class BrowserRenderProcessHost : public RenderProcessHost,
virtual void WidgetHidden();
virtual int VisibleWidgetCount() const;
virtual bool FastShutdownIfPossible();
- virtual bool SendWithTimeout(IPC::Message* msg, int timeout_ms);
virtual base::ProcessHandle GetHandle();
virtual TransportDIB* GetTransportDIB(TransportDIB::Id dib_id);
diff --git a/content/browser/renderer_host/clipboard_message_filter.cc b/content/browser/renderer_host/clipboard_message_filter.cc
index b1656b0..3a783f5 100644
--- a/content/browser/renderer_host/clipboard_message_filter.cc
+++ b/content/browser/renderer_host/clipboard_message_filter.cc
@@ -11,8 +11,8 @@
#endif
#include "base/stl_util-inl.h"
-#include "chrome/browser/browser_process.h"
#include "content/browser/clipboard_dispatcher.h"
+#include "content/browser/content_browser_client.h"
#include "content/common/clipboard_messages.h"
#include "googleurl/src/gurl.h"
#include "ipc/ipc_message_macros.h"
@@ -33,7 +33,8 @@ class WriteClipboardTask : public Task {
~WriteClipboardTask() {}
void Run() {
- g_browser_process->clipboard()->WriteObjects(*objects_.get());
+ content::GetContentClient()->browser()->GetClipboard()->WriteObjects(
+ *objects_.get());
}
private:
diff --git a/content/browser/renderer_host/mock_render_process_host.cc b/content/browser/renderer_host/mock_render_process_host.cc
index 1ad0d73..38a74b0 100644
--- a/content/browser/renderer_host/mock_render_process_host.cc
+++ b/content/browser/renderer_host/mock_render_process_host.cc
@@ -70,13 +70,6 @@ bool MockRenderProcessHost::FastShutdownIfPossible() {
return true;
}
-bool MockRenderProcessHost::SendWithTimeout(IPC::Message* msg, int timeout_ms) {
- // Save the message in the sink. Just ignore timeout_ms.
- sink_.OnMessageReceived(*msg);
- delete msg;
- return true;
-}
-
base::ProcessHandle MockRenderProcessHost::GetHandle() {
return base::kNullProcessHandle;
}
diff --git a/content/browser/renderer_host/mock_render_process_host.h b/content/browser/renderer_host/mock_render_process_host.h
index 67c96be..f49c4f5 100644
--- a/content/browser/renderer_host/mock_render_process_host.h
+++ b/content/browser/renderer_host/mock_render_process_host.h
@@ -49,9 +49,7 @@ class MockRenderProcessHost : public RenderProcessHost {
virtual int VisibleWidgetCount() const;
virtual void AddWord(const string16& word);
virtual bool FastShutdownIfPossible();
- virtual bool SendWithTimeout(IPC::Message* msg, int timeout_ms);
virtual base::ProcessHandle GetHandle();
-
virtual TransportDIB* GetTransportDIB(TransportDIB::Id dib_id);
// IPC::Channel::Sender via RenderProcessHost.
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc
index fa7aa90..0c03e9f 100644
--- a/content/browser/renderer_host/render_message_filter.cc
+++ b/content/browser/renderer_host/render_message_filter.cc
@@ -12,7 +12,6 @@
#include "base/threading/thread.h"
#include "base/threading/worker_pool.h"
#include "base/utf_string_conversions.h"
-#include "chrome/browser/browser_process.h"
#include "chrome/browser/download/download_types.h"
#include "chrome/browser/download/download_util.h"
#include "chrome/browser/profiles/profile.h"
@@ -275,7 +274,8 @@ RenderMessageFilter::RenderMessageFilter(
Profile* profile,
net::URLRequestContextGetter* request_context,
RenderWidgetHelper* render_widget_helper)
- : resource_dispatcher_host_(g_browser_process->resource_dispatcher_host()),
+ : resource_dispatcher_host_(
+ content::GetContentClient()->browser()->GetResourceDispatcherHost()),
plugin_service_(plugin_service),
profile_(profile),
extension_info_map_(profile->GetExtensionInfoMap()),
diff --git a/content/browser/renderer_host/render_process_host.h b/content/browser/renderer_host/render_process_host.h
index c8dfe01..94ff03f 100644
--- a/content/browser/renderer_host/render_process_host.h
+++ b/content/browser/renderer_host/render_process_host.h
@@ -13,7 +13,7 @@
#include "base/process.h"
#include "base/process_util.h"
#include "base/time.h"
-#include "ipc/ipc_sync_channel.h"
+#include "ipc/ipc_channel_proxy.h"
#include "ui/gfx/surface/transport_dib.h"
class Profile;
@@ -122,7 +122,7 @@ class RenderProcessHost : public IPC::Channel::Sender,
return listeners_.Lookup(routing_id);
}
- IPC::SyncChannel* channel() { return channel_.get(); }
+ IPC::ChannelProxy* channel() { return channel_.get(); }
// Called to inform the render process host of a new "max page id" for a
// render view host. The render process host computes the largest page id
@@ -204,11 +204,6 @@ class RenderProcessHost : public IPC::Channel::Sender,
// Returns True if it was able to do fast shutdown.
virtual bool FastShutdownIfPossible() = 0;
- // Synchronously sends the message, waiting for the specified timeout. The
- // implementor takes ownership of the given Message regardless of whether or
- // not this method succeeds. Returns true on success.
- virtual bool SendWithTimeout(IPC::Message* msg, int timeout_ms) = 0;
-
// Returns the process object associated with the child process. In certain
// tests or single-process mode, this will actually represent the current
// process.
@@ -269,7 +264,7 @@ class RenderProcessHost : public IPC::Channel::Sender,
protected:
// A proxy for our IPC::Channel that lives on the IO thread (see
// browser_process.h)
- scoped_ptr<IPC::SyncChannel> channel_;
+ scoped_ptr<IPC::ChannelProxy> channel_;
// The registered listeners. When this list is empty or all NULL, we should
// delete ourselves
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc
index 8ded247..0018fe5 100644
--- a/content/browser/renderer_host/render_widget_host_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -40,9 +40,9 @@ class RenderWidgetHostProcess : public MockRenderProcessHost {
update_msg_reply_flags_(0) {
// DANGER! This is a hack. The RenderWidgetHost checks the channel to see
// if the process is still alive, but it doesn't actually dereference it.
- // An IPC::SyncChannel is nontrivial, so we just fake it here. If you end up
+ // An IPC::ChannelProxy is nontrivial, so we just fake it here. If you end up
// crashing by dereferencing 1, then you'll have to make a real channel.
- channel_.reset(reinterpret_cast<IPC::SyncChannel*>(0x1));
+ channel_.reset(reinterpret_cast<IPC::ChannelProxy*>(0x1));
}
~RenderWidgetHostProcess() {
// We don't want to actually delete the channel, since it's not a real
diff --git a/content/browser/tab_contents/interstitial_page.cc b/content/browser/tab_contents/interstitial_page.cc
index 6821f7e..85edfb9 100644
--- a/content/browser/tab_contents/interstitial_page.cc
+++ b/content/browser/tab_contents/interstitial_page.cc
@@ -11,8 +11,8 @@
#include "base/string_util.h"
#include "base/threading/thread.h"
#include "base/utf_string_conversions.h"
-#include "chrome/browser/browser_process.h"
#include "content/browser/browser_thread.h"
+#include "content/browser/content_browser_client.h"
#include "content/browser/renderer_host/render_process_host.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_widget_host_view.h"
@@ -45,7 +45,8 @@ class ResourceRequestTask : public Task {
process_id_(process_id),
render_view_host_id_(render_view_host_id),
resource_dispatcher_host_(
- g_browser_process->resource_dispatcher_host()) {
+ content::GetContentClient()->browser()->
+ GetResourceDispatcherHost()) {
}
virtual void Run() {
@@ -560,8 +561,10 @@ void InterstitialPage::TakeActionOnResourceDispatcher(
// we don't have one.
RenderViewHost* rvh = RenderViewHost::FromID(original_child_id_,
original_rvh_id_);
- if (!rvh || !g_browser_process->resource_dispatcher_host())
+ if (!rvh ||
+ !content::GetContentClient()->browser()->GetResourceDispatcherHost()) {
return;
+ }
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
diff --git a/content/browser/utility_process_host.cc b/content/browser/utility_process_host.cc
index 44a8037..ce7e1d2 100644
--- a/content/browser/utility_process_host.cc
+++ b/content/browser/utility_process_host.cc
@@ -6,8 +6,8 @@
#include "base/command_line.h"
#include "base/message_loop.h"
-#include "chrome/browser/browser_process.h"
-#include "chrome/common/chrome_switches.h"
+#include "content/browser/content_browser_client.h"
+#include "content/common/content_switches.h"
#include "content/common/utility_messages.h"
#include "ipc/ipc_switches.h"
#include "ui/base/ui_base_switches.h"
@@ -87,7 +87,8 @@ bool UtilityProcessHost::StartProcess() {
cmd_line->AppendSwitchASCII(switches::kProcessType,
switches::kUtilityProcess);
cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id());
- std::string locale = g_browser_process->GetApplicationLocale();
+ std::string locale =
+ content::GetContentClient()->browser()->GetApplicationLocale();
cmd_line->AppendSwitchASCII(switches::kLang, locale);
const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
@@ -96,11 +97,6 @@ bool UtilityProcessHost::StartProcess() {
if (browser_command_line.HasSwitch(switches::kNoSandbox))
cmd_line->AppendSwitch(switches::kNoSandbox);
- if (browser_command_line.HasSwitch(
- switches::kEnableExperimentalExtensionApis)) {
- cmd_line->AppendSwitch(switches::kEnableExperimentalExtensionApis);
- }
-
#if defined(OS_POSIX)
// TODO(port): Sandbox this on Linux. Also, zygote this to work with
// Linux updating.
diff --git a/content/common/content_switches.cc b/content/common/content_switches.cc
index 16560b7..c27340f 100644
--- a/content/common/content_switches.cc
+++ b/content/common/content_switches.cc
@@ -378,6 +378,11 @@ const char kUnlimitedQuotaForIndexedDB[] = "unlimited-quota-for-indexeddb";
// A string used to override the default user agent with a custom one.
const char kUserAgent[] = "user-agent";
+// On POSIX only: the contents of this flag are prepended to the utility
+// process command line. Useful values might be "valgrind" or "xterm -e gdb
+// --args".
+const char kUtilityCmdPrefix[] = "utility-cmd-prefix";
+
// Causes the process to run as a utility subprocess.
const char kUtilityProcess[] = "utility";
diff --git a/content/common/content_switches.h b/content/common/content_switches.h
index acb4276..64adb1e 100644
--- a/content/common/content_switches.h
+++ b/content/common/content_switches.h
@@ -120,6 +120,7 @@ extern const char kTestSandbox[];
extern const char kUnlimitedQuotaForFiles[];
extern const char kUnlimitedQuotaForIndexedDB[];
extern const char kUserAgent[];
+extern const char kUtilityCmdPrefix[];
extern const char kUtilityProcess[];
extern const char kUtilityProcessAllowedDir[];
extern const char kWaitForDebuggerChildren[];