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

Unified Diff: content/shell/shell_content_browser_client.cc

Issue 13818008: [content shell] only send the hyphenation file after the process was created (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
« no previous file with comments | « content/shell/shell_content_browser_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/shell_content_browser_client.cc
diff --git a/content/shell/shell_content_browser_client.cc b/content/shell/shell_content_browser_client.cc
index 16055835b235362fa785a4819218d463daecfa95..e4ef8106e99285a4cd07e967f61b6f36237e546b 100644
--- a/content/shell/shell_content_browser_client.cc
+++ b/content/shell/shell_content_browser_client.cc
@@ -7,6 +7,8 @@
#include "base/command_line.h"
#include "base/file_util.h"
#include "base/path_service.h"
+#include "content/public/browser/notification_service.h"
+#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/resource_dispatcher_host.h"
#include "content/public/browser/storage_partition.h"
@@ -117,12 +119,9 @@ void ShellContentBrowserClient::RenderProcessHostCreated(
BrowserContext::GetDefaultStoragePartition(browser_context())
->GetQuotaManager()));
host->Send(new ShellViewMsg_SetWebKitSourceDir(webkit_source_dir_));
-
- if (hyphen_dictionary_file_ != base::kInvalidPlatformFileValue) {
- IPC::PlatformFileForTransit file = IPC::GetFileHandleForProcess(
- hyphen_dictionary_file_, host->GetHandle(), false);
- host->Send(new ShellViewMsg_LoadHyphenDictionary(file));
- }
+ registrar_.Add(this,
+ NOTIFICATION_RENDERER_PROCESS_CREATED,
+ Source<RenderProcessHost>(host));
}
net::URLRequestContextGetter* ShellContentBrowserClient::CreateRequestContext(
@@ -215,6 +214,28 @@ void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
}
#endif
+void ShellContentBrowserClient::Observe(int type,
+ const NotificationSource& source,
+ const NotificationDetails& details) {
+ switch (type) {
+ case NOTIFICATION_RENDERER_PROCESS_CREATED: {
+ registrar_.Remove(this,
+ NOTIFICATION_RENDERER_PROCESS_CREATED,
+ source);
+ if (hyphen_dictionary_file_ != base::kInvalidPlatformFileValue) {
+ RenderProcessHost* host = Source<RenderProcessHost>(source).ptr();
+ IPC::PlatformFileForTransit file = IPC::GetFileHandleForProcess(
+ hyphen_dictionary_file_, host->GetHandle(), false);
+ host->Send(new ShellViewMsg_LoadHyphenDictionary(file));
+ }
+ break;
+ }
+
+ default:
+ NOTREACHED();
+ }
+}
+
ShellBrowserContext* ShellContentBrowserClient::browser_context() {
return shell_browser_main_parts_->browser_context();
}
« no previous file with comments | « content/shell/shell_content_browser_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698