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

Side by Side Diff: extensions/browser/extension_host.cc

Issue 1008913002: Remove RenderViewHost parameter from WebContentsObserver::Did{Start|Stop}Loading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 9 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/extension_host.h" 5 #include "extensions/browser/extension_host.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "base/profiler/scoped_tracker.h" 10 #include "base/profiler/scoped_tracker.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 // TODO(aa): This is suspicious. There can be multiple views in an extension, 261 // TODO(aa): This is suspicious. There can be multiple views in an extension,
262 // and they aren't all going to use ExtensionHost. This should be in someplace 262 // and they aren't all going to use ExtensionHost. This should be in someplace
263 // more central, like EPM maybe. 263 // more central, like EPM maybe.
264 content::NotificationService::current()->Notify( 264 content::NotificationService::current()->Notify(
265 extensions::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, 265 extensions::NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
266 content::Source<BrowserContext>(browser_context_), 266 content::Source<BrowserContext>(browser_context_),
267 content::Details<ExtensionHost>(this)); 267 content::Details<ExtensionHost>(this));
268 } 268 }
269 269
270 void ExtensionHost::DidStartLoading(content::RenderViewHost* render_view_host) { 270 void ExtensionHost::DidStartLoading() {
271 FOR_EACH_OBSERVER(DeferredStartRenderHostObserver, 271 FOR_EACH_OBSERVER(DeferredStartRenderHostObserver,
272 deferred_start_render_host_observer_list_, 272 deferred_start_render_host_observer_list_,
273 OnDeferredStartRenderHostDidStartLoading(this)); 273 OnDeferredStartRenderHostDidStartLoading(this));
274 } 274 }
275 275
276 void ExtensionHost::DidStopLoading(content::RenderViewHost* render_view_host) { 276 void ExtensionHost::DidStopLoading() {
277 // Only record UMA for the first load. Subsequent loads will likely behave 277 // Only record UMA for the first load. Subsequent loads will likely behave
278 // quite different, and it's first load we're most interested in. 278 // quite different, and it's first load we're most interested in.
279 if (!has_loaded_once_) 279 if (!has_loaded_once_)
280 RecordStopLoadingUMA(); 280 RecordStopLoadingUMA();
281 has_loaded_once_ = true; 281 has_loaded_once_ = true;
282 OnDidStopLoading(); 282 OnDidStopLoading();
283 content::NotificationService::current()->Notify( 283 content::NotificationService::current()->Notify(
284 extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING, 284 extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
285 content::Source<BrowserContext>(browser_context_), 285 content::Source<BrowserContext>(browser_context_),
286 content::Details<ExtensionHost>(this)); 286 content::Details<ExtensionHost>(this));
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 UMA_HISTOGRAM_MEDIUM_TIMES("Extensions.BackgroundPageLoadTime2", 465 UMA_HISTOGRAM_MEDIUM_TIMES("Extensions.BackgroundPageLoadTime2",
466 load_start_->Elapsed()); 466 load_start_->Elapsed());
467 } 467 }
468 } else if (extension_host_type_ == VIEW_TYPE_EXTENSION_POPUP) { 468 } else if (extension_host_type_ == VIEW_TYPE_EXTENSION_POPUP) {
469 UMA_HISTOGRAM_MEDIUM_TIMES("Extensions.PopupLoadTime2", 469 UMA_HISTOGRAM_MEDIUM_TIMES("Extensions.PopupLoadTime2",
470 load_start_->Elapsed()); 470 load_start_->Elapsed());
471 } 471 }
472 } 472 }
473 473
474 } // namespace extensions 474 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698