| 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 3552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3563 is_loading_ = is_loading; | 3563 is_loading_ = is_loading; |
| 3564 waiting_for_response_ = is_loading; | 3564 waiting_for_response_ = is_loading; |
| 3565 is_load_to_different_document_ = to_different_document; | 3565 is_load_to_different_document_ = to_different_document; |
| 3566 | 3566 |
| 3567 if (delegate_) | 3567 if (delegate_) |
| 3568 delegate_->LoadingStateChanged(this, to_different_document); | 3568 delegate_->LoadingStateChanged(this, to_different_document); |
| 3569 NotifyNavigationStateChanged(INVALIDATE_TYPE_LOAD); | 3569 NotifyNavigationStateChanged(INVALIDATE_TYPE_LOAD); |
| 3570 | 3570 |
| 3571 std::string url = (details ? details->url.possibly_invalid_spec() : "NULL"); | 3571 std::string url = (details ? details->url.possibly_invalid_spec() : "NULL"); |
| 3572 if (is_loading) { | 3572 if (is_loading) { |
| 3573 TRACE_EVENT_ASYNC_BEGIN1("browser,navigation", "WebContentsImpl Loading", | 3573 TRACE_EVENT_ASYNC_BEGIN2("browser,navigation", "WebContentsImpl Loading", |
| 3574 this, "URL", url); | 3574 this, "URL", url, "Main FrameTreeNode id", |
| 3575 GetFrameTree()->root()->frame_tree_node_id()); |
| 3575 FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidStartLoading()); | 3576 FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidStartLoading()); |
| 3576 } else { | 3577 } else { |
| 3577 TRACE_EVENT_ASYNC_END1("browser,navigation", "WebContentsImpl Loading", | 3578 TRACE_EVENT_ASYNC_END1("browser,navigation", "WebContentsImpl Loading", |
| 3578 this, "URL", url); | 3579 this, "URL", url); |
| 3579 FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidStopLoading()); | 3580 FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidStopLoading()); |
| 3580 } | 3581 } |
| 3581 | 3582 |
| 3582 // TODO(avi): Remove. http://crbug.com/170921 | 3583 // TODO(avi): Remove. http://crbug.com/170921 |
| 3583 int type = is_loading ? NOTIFICATION_LOAD_START : NOTIFICATION_LOAD_STOP; | 3584 int type = is_loading ? NOTIFICATION_LOAD_START : NOTIFICATION_LOAD_STOP; |
| 3584 NotificationDetails det = NotificationService::NoDetails(); | 3585 NotificationDetails det = NotificationService::NoDetails(); |
| (...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4702 const WebContentsObserver::MediaPlayerId& id) { | 4703 const WebContentsObserver::MediaPlayerId& id) { |
| 4703 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); | 4704 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); |
| 4704 } | 4705 } |
| 4705 | 4706 |
| 4706 void WebContentsImpl::MediaStoppedPlaying( | 4707 void WebContentsImpl::MediaStoppedPlaying( |
| 4707 const WebContentsObserver::MediaPlayerId& id) { | 4708 const WebContentsObserver::MediaPlayerId& id) { |
| 4708 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); | 4709 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); |
| 4709 } | 4710 } |
| 4710 | 4711 |
| 4711 } // namespace content | 4712 } // namespace content |
| OLD | NEW |