Index: content/browser/renderer_host/browser_render_process_host.cc |
diff --git a/content/browser/renderer_host/browser_render_process_host.cc b/content/browser/renderer_host/browser_render_process_host.cc |
index 1c2d42d8937c9a911d4536a4eb286ccfb2a3085a..75410e5e174f92d91d5862c231df20f6c74f29e2 100644 |
--- a/content/browser/renderer_host/browser_render_process_host.cc |
+++ b/content/browser/renderer_host/browser_render_process_host.cc |
@@ -78,6 +78,7 @@ |
#include "ipc/ipc_platform_file.h" |
#include "ipc/ipc_switches.h" |
#include "media/base/media_switches.h" |
+#include "net/base/network_change_notifier.h" |
#include "net/url_request/url_request_context_getter.h" |
#include "ui/base/ui_base_switches.h" |
#include "ui/gfx/gl/gl_switches.h" |
@@ -897,6 +898,11 @@ void BrowserRenderProcessHost::OnProcessLaunched() { |
if (max_page_id_ != -1) |
Send(new ViewMsg_SetNextPageID(max_page_id_ + 1)); |
+ // WebKit's network state (window.navigator.onLine) defaults to true, |
+ // so if we're offline we need to notify the renderer at startup. |
+ if (net::NetworkChangeNotifier::IsOffline()) |
+ Send(new ViewMsg_NetworkStateChanged(false)); |
+ |
// NOTE: This needs to be before sending queued messages because |
// ExtensionService uses this notification to initialize the renderer process |
// with state that must be there before any JavaScript executes. |