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

Unified Diff: content/browser/renderer_host/browser_render_process_host.cc

Issue 7259004: Convert ViewMsg_NetworkStateChanged from routed -> control, allowing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix linux build Created 9 years, 6 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/browser/net/browser_online_state_observer.cc ('k') | content/browser/tab_contents/tab_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 aa580dd673d968091c8b0c3ff2a8c965b0e4289e..3dfeb2b16f68ae94fd9017502119e2d31d471889 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"
@@ -887,6 +888,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.
« no previous file with comments | « content/browser/net/browser_online_state_observer.cc ('k') | content/browser/tab_contents/tab_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698