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

Side by Side Diff: chrome/browser/after_startup_task_utils.cc

Issue 1194383003: Add a flag showing whether the current request was ignored by a handler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix trybot failures (DidFailProvisionalLoad calls in unit tests) Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/after_startup_task_utils.h" 5 #include "chrome/browser/after_startup_task_utils.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "base/process/process_info.h" 10 #include "base/process/process_info.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 // WebContentsObserver overrides 131 // WebContentsObserver overrides
132 void DidFinishLoad(content::RenderFrameHost* render_frame_host, 132 void DidFinishLoad(content::RenderFrameHost* render_frame_host,
133 const GURL& validated_url) override { 133 const GURL& validated_url) override {
134 if (!render_frame_host->GetParent()) 134 if (!render_frame_host->GetParent())
135 OnStartupComplete(); 135 OnStartupComplete();
136 } 136 }
137 137
138 void DidFailLoad(content::RenderFrameHost* render_frame_host, 138 void DidFailLoad(content::RenderFrameHost* render_frame_host,
139 const GURL& validated_url, 139 const GURL& validated_url,
140 int error_code, 140 int error_code,
141 const base::string16& error_description) override { 141 const base::string16& error_description,
142 bool was_ignored_by_handler) override {
142 if (!render_frame_host->GetParent()) 143 if (!render_frame_host->GetParent())
143 OnStartupComplete(); 144 OnStartupComplete();
144 } 145 }
145 146
146 void WebContentsDestroyed() override { OnStartupComplete(); } 147 void WebContentsDestroyed() override { OnStartupComplete(); }
147 148
148 base::WeakPtrFactory<StartupObserver> weak_factory_; 149 base::WeakPtrFactory<StartupObserver> weak_factory_;
149 150
150 DISALLOW_COPY_AND_ASSIGN(StartupObserver); 151 DISALLOW_COPY_AND_ASSIGN(StartupObserver);
151 }; 152 };
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 return ::IsBrowserStartupComplete(); 215 return ::IsBrowserStartupComplete();
215 } 216 }
216 217
217 void AfterStartupTaskUtils::UnsafeResetForTesting() { 218 void AfterStartupTaskUtils::UnsafeResetForTesting() {
218 DCHECK(g_after_startup_tasks.Get().empty()); 219 DCHECK(g_after_startup_tasks.Get().empty());
219 if (!IsBrowserStartupComplete()) 220 if (!IsBrowserStartupComplete())
220 return; 221 return;
221 g_startup_complete_flag.Get().UnsafeResetForTesting(); 222 g_startup_complete_flag.Get().UnsafeResetForTesting();
222 DCHECK(!IsBrowserStartupComplete()); 223 DCHECK(!IsBrowserStartupComplete());
223 } 224 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698