| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 3560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3571 is_loading_ = is_loading; | 3571 is_loading_ = is_loading; |
| 3572 waiting_for_response_ = is_loading; | 3572 waiting_for_response_ = is_loading; |
| 3573 is_load_to_different_document_ = to_different_document; | 3573 is_load_to_different_document_ = to_different_document; |
| 3574 | 3574 |
| 3575 if (delegate_) | 3575 if (delegate_) |
| 3576 delegate_->LoadingStateChanged(this, to_different_document); | 3576 delegate_->LoadingStateChanged(this, to_different_document); |
| 3577 NotifyNavigationStateChanged(INVALIDATE_TYPE_LOAD); | 3577 NotifyNavigationStateChanged(INVALIDATE_TYPE_LOAD); |
| 3578 | 3578 |
| 3579 std::string url = (details ? details->url.possibly_invalid_spec() : "NULL"); | 3579 std::string url = (details ? details->url.possibly_invalid_spec() : "NULL"); |
| 3580 if (is_loading) { | 3580 if (is_loading) { |
| 3581 TRACE_EVENT_ASYNC_BEGIN1("browser,navigation", "WebContentsImpl Loading", | 3581 TRACE_EVENT_ASYNC_BEGIN2("browser,navigation", "WebContentsImpl Loading", |
| 3582 this, "URL", url); | 3582 this, "URL", url, "Main FrameTreeNode id", |
| 3583 GetFrameTree()->root()->frame_tree_node_id()); |
| 3583 FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidStartLoading()); | 3584 FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidStartLoading()); |
| 3584 } else { | 3585 } else { |
| 3585 TRACE_EVENT_ASYNC_END1("browser,navigation", "WebContentsImpl Loading", | 3586 TRACE_EVENT_ASYNC_END1("browser,navigation", "WebContentsImpl Loading", |
| 3586 this, "URL", url); | 3587 this, "URL", url); |
| 3587 FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidStopLoading()); | 3588 FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidStopLoading()); |
| 3588 } | 3589 } |
| 3589 | 3590 |
| 3590 // TODO(avi): Remove. http://crbug.com/170921 | 3591 // TODO(avi): Remove. http://crbug.com/170921 |
| 3591 int type = is_loading ? NOTIFICATION_LOAD_START : NOTIFICATION_LOAD_STOP; | 3592 int type = is_loading ? NOTIFICATION_LOAD_START : NOTIFICATION_LOAD_STOP; |
| 3592 NotificationDetails det = NotificationService::NoDetails(); | 3593 NotificationDetails det = NotificationService::NoDetails(); |
| (...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4715 const WebContentsObserver::MediaPlayerId& id) { | 4716 const WebContentsObserver::MediaPlayerId& id) { |
| 4716 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); | 4717 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); |
| 4717 } | 4718 } |
| 4718 | 4719 |
| 4719 void WebContentsImpl::MediaStoppedPlaying( | 4720 void WebContentsImpl::MediaStoppedPlaying( |
| 4720 const WebContentsObserver::MediaPlayerId& id) { | 4721 const WebContentsObserver::MediaPlayerId& id) { |
| 4721 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); | 4722 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); |
| 4722 } | 4723 } |
| 4723 | 4724 |
| 4724 } // namespace content | 4725 } // namespace content |
| OLD | NEW |