summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/about_handler.cc2
-rw-r--r--chrome/common/about_handler.h5
-rw-r--r--chrome/common/child_process.cc8
-rw-r--r--chrome/common/child_process.h7
-rw-r--r--chrome/common/child_process_host.cc2
-rw-r--r--chrome/common/child_process_host.h12
-rw-r--r--chrome/common/child_process_logging.h3
-rw-r--r--chrome/common/child_process_logging_win.cc1
-rw-r--r--chrome/common/child_thread.cc15
-rw-r--r--chrome/common/child_thread.h14
-rw-r--r--chrome/common/chrome_plugin_util.h3
-rw-r--r--chrome/common/important_file_writer.h2
-rw-r--r--chrome/common/ipc_test_sink.cc1
-rw-r--r--chrome/common/ipc_test_sink.h3
-rw-r--r--chrome/common/main_function_params.h1
-rw-r--r--chrome/common/metrics_helpers.h2
-rw-r--r--chrome/common/nacl_cmd_line.cc46
-rw-r--r--chrome/common/nacl_cmd_line.h2
-rw-r--r--chrome/common/socket_stream_dispatcher.cc2
19 files changed, 86 insertions, 45 deletions
diff --git a/chrome/common/about_handler.cc b/chrome/common/about_handler.cc
index 84658a0..d2121b8 100644
--- a/chrome/common/about_handler.cc
+++ b/chrome/common/about_handler.cc
@@ -3,6 +3,8 @@
// found in the LICENSE file.
#include "chrome/common/about_handler.h"
+#include "chrome/common/url_constants.h"
+#include "googleurl/src/gurl.h"
namespace chrome_about_handler {
diff --git a/chrome/common/about_handler.h b/chrome/common/about_handler.h
index d3c74f4..49b16ad 100644
--- a/chrome/common/about_handler.h
+++ b/chrome/common/about_handler.h
@@ -6,8 +6,9 @@
#define CHROME_COMMON_ABOUT_HANDLER_H__
#pragma once
-#include "chrome/common/url_constants.h"
-#include "googleurl/src/gurl.h"
+#include <stddef.h>
+
+class GURL;
namespace chrome_about_handler {
diff --git a/chrome/common/child_process.cc b/chrome/common/child_process.cc
index 115308e..dd6fd40 100644
--- a/chrome/common/child_process.cc
+++ b/chrome/common/child_process.cc
@@ -48,6 +48,14 @@ ChildProcess::~ChildProcess() {
child_process_ = NULL;
}
+ChildThread* ChildProcess::main_thread() {
+ return main_thread_.get();
+}
+
+void ChildProcess::set_main_thread(ChildThread* thread) {
+ main_thread_.reset(thread);
+}
+
void ChildProcess::AddRefProcess() {
DCHECK(!main_thread_.get() || // null in unittests.
MessageLoop::current() == main_thread_->message_loop());
diff --git a/chrome/common/child_process.h b/chrome/common/child_process.h
index 7b8e500..bc878de 100644
--- a/chrome/common/child_process.h
+++ b/chrome/common/child_process.h
@@ -10,7 +10,8 @@
#include "base/scoped_ptr.h"
#include "base/thread.h"
#include "base/waitable_event.h"
-#include "chrome/common/child_thread.h"
+
+class ChildThread;
// Base class for child processes of the browser process (i.e. renderer and
// plugin host). This is a singleton object for each child process.
@@ -21,8 +22,8 @@ class ChildProcess {
virtual ~ChildProcess();
// Getter for the child process' main thread.
- ChildThread* main_thread() { return main_thread_.get(); }
- void set_main_thread(ChildThread* thread) { main_thread_.reset(thread); }
+ ChildThread* main_thread();
+ void set_main_thread(ChildThread* thread);
MessageLoop* io_message_loop() { return io_thread_.message_loop(); }
diff --git a/chrome/common/child_process_host.cc b/chrome/common/child_process_host.cc
index bcd0c3d..9626976 100644
--- a/chrome/common/child_process_host.cc
+++ b/chrome/common/child_process_host.cc
@@ -12,6 +12,8 @@
#include "chrome/common/chrome_paths_internal.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/plugin_messages.h"
+#include "ipc/ipc_logging.h"
+#include "ipc/ipc_message.h"
#if defined(OS_LINUX)
#include "base/linux_util.h"
diff --git a/chrome/common/child_process_host.h b/chrome/common/child_process_host.h
index 8628acc..7423a42 100644
--- a/chrome/common/child_process_host.h
+++ b/chrome/common/child_process_host.h
@@ -6,13 +6,10 @@
#define CHROME_COMMON_CHILD_PROCESS_HOST_H_
#pragma once
-#include <list>
#include <string>
-// Must be included early (e.g. before chrome/common/plugin_messages.h)
-#include "ipc/ipc_logging.h"
+#include "build/build_config.h"
-// Putting this before ipc_logging.h does not work (OS_WIN isn't defined)
#if defined(OS_WIN)
#include <windows.h>
#endif // defined(OS_WIN)
@@ -23,9 +20,12 @@
#include "chrome/common/notification_type.h"
#include "ipc/ipc_channel.h"
-
class CommandLine;
+namespace IPC {
+class Message;
+}
+
// Provides common functionality for hosting a child process and processing IPC
// messages between the host and the child process. Subclasses are responsible
// for the actual launching and terminating of the child processes.
@@ -118,6 +118,8 @@ class ChildProcessHost : public IPC::Channel::Listener {
bool opening_channel_; // True while we're waiting the channel to be opened.
scoped_ptr<IPC::Channel> channel_;
std::string channel_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChildProcessHost);
};
#endif // CHROME_COMMON_CHILD_PROCESS_HOST_H_
diff --git a/chrome/common/child_process_logging.h b/chrome/common/child_process_logging.h
index ec5d2c5..6de7bfe 100644
--- a/chrome/common/child_process_logging.h
+++ b/chrome/common/child_process_logging.h
@@ -10,9 +10,10 @@
#include <string>
#include "base/basictypes.h"
-#include "chrome/common/gpu_info.h"
#include "googleurl/src/gurl.h"
+class GPUInfo;
+
#if defined(OS_WIN)
// The maximum number of active extensions we will report.
// Also used in chrome/app, but we define it here to avoid a common->app
diff --git a/chrome/common/child_process_logging_win.cc b/chrome/common/child_process_logging_win.cc
index f5ffd84..046244f 100644
--- a/chrome/common/child_process_logging_win.cc
+++ b/chrome/common/child_process_logging_win.cc
@@ -10,6 +10,7 @@
#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
#include "chrome/common/chrome_constants.h"
+#include "chrome/common/gpu_info.h"
#include "chrome/installer/util/google_update_settings.h"
#include "googleurl/src/gurl.h"
diff --git a/chrome/common/child_thread.cc b/chrome/common/child_thread.cc
index 91d276e..126fc2b 100644
--- a/chrome/common/child_thread.cc
+++ b/chrome/common/child_thread.cc
@@ -4,20 +4,22 @@
#include "chrome/common/child_thread.h"
+#include "base/message_loop.h"
#include "base/string_util.h"
#include "base/command_line.h"
#include "chrome/common/child_process.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/plugin_messages.h"
+#include "chrome/common/resource_dispatcher.h"
#include "chrome/common/socket_stream_dispatcher.h"
#include "ipc/ipc_logging.h"
#include "ipc/ipc_message.h"
+#include "ipc/ipc_sync_channel.h"
#include "ipc/ipc_sync_message_filter.h"
#include "ipc/ipc_switches.h"
#include "webkit/glue/webkit_glue.h"
-
ChildThread::ChildThread() {
channel_name_ = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kProcessChannelID);
@@ -118,6 +120,17 @@ webkit_glue::ResourceLoaderBridge* ChildThread::CreateBridge(
CreateBridge(request_info, host_renderer_id, host_render_view_id);
}
+ResourceDispatcher* ChildThread::resource_dispatcher() {
+ return resource_dispatcher_.get();
+}
+
+IPC::SyncMessageFilter* ChildThread::sync_message_filter() {
+ return sync_message_filter_;
+}
+
+MessageLoop* ChildThread::message_loop() {
+ return message_loop_;
+}
void ChildThread::OnMessageReceived(const IPC::Message& msg) {
// Resource responses are sent to the resource dispatcher.
diff --git a/chrome/common/child_thread.h b/chrome/common/child_thread.h
index b170d7d..7f9c3f8 100644
--- a/chrome/common/child_thread.h
+++ b/chrome/common/child_thread.h
@@ -9,14 +9,16 @@
#include "base/basictypes.h"
#include "base/scoped_ptr.h"
#include "chrome/common/message_router.h"
-#include "chrome/common/resource_dispatcher.h"
-#include "ipc/ipc_sync_channel.h"
#include "ipc/ipc_message.h"
+#include "webkit/glue/resource_loader_bridge.h"
+class MessageLoop;
class NotificationService;
+class ResourceDispatcher;
class SocketStreamDispatcher;
namespace IPC {
+class SyncChannel;
class SyncMessageFilter;
}
@@ -46,9 +48,7 @@ class ChildThread : public IPC::Channel::Listener,
int host_renderer_id,
int host_render_view_id);
- ResourceDispatcher* resource_dispatcher() {
- return resource_dispatcher_.get();
- }
+ ResourceDispatcher* resource_dispatcher();
SocketStreamDispatcher* socket_stream_dispatcher() {
return socket_stream_dispatcher_.get();
@@ -56,9 +56,9 @@ class ChildThread : public IPC::Channel::Listener,
// Safe to call on any thread, as long as it's guaranteed that the thread's
// lifetime is less than the main thread.
- IPC::SyncMessageFilter* sync_message_filter() { return sync_message_filter_; }
+ IPC::SyncMessageFilter* sync_message_filter();
- MessageLoop* message_loop() { return message_loop_; }
+ MessageLoop* message_loop();
// Returns the one child thread.
static ChildThread* current();
diff --git a/chrome/common/chrome_plugin_util.h b/chrome/common/chrome_plugin_util.h
index 88873bb..f9e7673 100644
--- a/chrome/common/chrome_plugin_util.h
+++ b/chrome/common/chrome_plugin_util.h
@@ -39,7 +39,8 @@ struct ScopableCPRequest : public CPRequest {
// This is a base class for plugin-related objects that need to go away when
// the plugin unloads. This object also verifies that it is created and
// destroyed on the same thread.
-class PluginHelper : public NotificationObserver, public NonThreadSafe {
+class PluginHelper : public NotificationObserver,
+ public NonThreadSafe {
public:
static void DestroyAllHelpersForPlugin(ChromePluginLib* plugin);
diff --git a/chrome/common/important_file_writer.h b/chrome/common/important_file_writer.h
index a25ad5f..5fdabce 100644
--- a/chrome/common/important_file_writer.h
+++ b/chrome/common/important_file_writer.h
@@ -62,7 +62,7 @@ class ImportantFileWriter : public NonThreadSafe {
// of destruction.
~ImportantFileWriter();
- FilePath path() const { return path_; }
+ const FilePath& path() const { return path_; }
// Returns true if there is a scheduled write pending which has not yet
// been started.
diff --git a/chrome/common/ipc_test_sink.cc b/chrome/common/ipc_test_sink.cc
index 04fd065..45db8f5 100644
--- a/chrome/common/ipc_test_sink.cc
+++ b/chrome/common/ipc_test_sink.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "chrome/common/ipc_test_sink.h"
+#include "ipc/ipc_message.h"
namespace IPC {
diff --git a/chrome/common/ipc_test_sink.h b/chrome/common/ipc_test_sink.h
index 8fc621a..caf6276 100644
--- a/chrome/common/ipc_test_sink.h
+++ b/chrome/common/ipc_test_sink.h
@@ -11,10 +11,11 @@
#include "base/basictypes.h"
#include "ipc/ipc_channel.h"
-#include "ipc/ipc_message.h"
namespace IPC {
+class Message;
+
// This test sink provides a "sink" for IPC messages that are sent. It allows
// the caller to query messages received in various different ways. It is
// designed for tests for objects that use the IPC system.
diff --git a/chrome/common/main_function_params.h b/chrome/common/main_function_params.h
index 6d5291f..0f0ed37 100644
--- a/chrome/common/main_function_params.h
+++ b/chrome/common/main_function_params.h
@@ -16,6 +16,7 @@
namespace base {
class ScopedNSAutoreleasePool;
};
+
class Task;
struct MainFunctionParams {
diff --git a/chrome/common/metrics_helpers.h b/chrome/common/metrics_helpers.h
index a137ecf..990a9fe 100644
--- a/chrome/common/metrics_helpers.h
+++ b/chrome/common/metrics_helpers.h
@@ -219,6 +219,8 @@ class MetricsServiceBase {
// For histograms, record what we've already logged (as a sample for each
// histogram) so that we can send only the delta with the next log.
LoggedSampleMap logged_samples_;
+
+ DISALLOW_COPY_AND_ASSIGN(MetricsServiceBase);
};
#endif // CHROME_COMMON_METRICS_HELPERS_H_
diff --git a/chrome/common/nacl_cmd_line.cc b/chrome/common/nacl_cmd_line.cc
index 82c2634..c2a3b8c 100644
--- a/chrome/common/nacl_cmd_line.cc
+++ b/chrome/common/nacl_cmd_line.cc
@@ -8,27 +8,29 @@
#include "chrome/common/logging_chrome.h"
namespace nacl {
- void CopyNaClCommandLineArguments(CommandLine* cmd_line) {
- const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
- if (logging::DialogsAreSuppressed())
- cmd_line->AppendSwitch(switches::kNoErrorDialogs);
- // Propagate the following switches to the NaCl loader command line (along
- // with any associated values) if present in the browser command line.
- // TODO(gregoryd): check which flags of those below can be supported.
- static const char* const kSwitchNames[] = {
- switches::kNoSandbox,
- switches::kTestNaClSandbox,
- switches::kDisableBreakpad,
- switches::kFullMemoryCrashReport,
- switches::kEnableLogging,
- switches::kDisableLogging,
- switches::kLoggingLevel,
- switches::kEnableDCHECK,
- switches::kSilentDumpOnDCHECK,
- switches::kMemoryProfiling,
- };
- cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames,
- arraysize(kSwitchNames));
- }
+void CopyNaClCommandLineArguments(CommandLine* cmd_line) {
+ const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
+ if (logging::DialogsAreSuppressed())
+ cmd_line->AppendSwitch(switches::kNoErrorDialogs);
+
+ // Propagate the following switches to the NaCl loader command line (along
+ // with any associated values) if present in the browser command line.
+ // TODO(gregoryd): check which flags of those below can be supported.
+ static const char* const kSwitchNames[] = {
+ switches::kNoSandbox,
+ switches::kTestNaClSandbox,
+ switches::kDisableBreakpad,
+ switches::kFullMemoryCrashReport,
+ switches::kEnableLogging,
+ switches::kDisableLogging,
+ switches::kLoggingLevel,
+ switches::kEnableDCHECK,
+ switches::kSilentDumpOnDCHECK,
+ switches::kMemoryProfiling,
+ };
+ cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames,
+ arraysize(kSwitchNames));
+}
+
}
diff --git a/chrome/common/nacl_cmd_line.h b/chrome/common/nacl_cmd_line.h
index cb704b1..e2edccc 100644
--- a/chrome/common/nacl_cmd_line.h
+++ b/chrome/common/nacl_cmd_line.h
@@ -6,7 +6,7 @@
#define CHROME_COMMON_NACL_CMD_LINE_H_
#pragma once
-#include "base/command_line.h"
+class CommandLine;
namespace nacl {
// Copy all the relevant arguments from the command line of the current
diff --git a/chrome/common/socket_stream_dispatcher.cc b/chrome/common/socket_stream_dispatcher.cc
index 97aed21..83ef0e1 100644
--- a/chrome/common/socket_stream_dispatcher.cc
+++ b/chrome/common/socket_stream_dispatcher.cc
@@ -7,7 +7,9 @@
#include <vector>
#include "base/id_map.h"
+#include "base/message_loop.h"
#include "base/ref_counted.h"
+#include "base/task.h"
#include "chrome/common/child_thread.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/net/socket_stream.h"