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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 263973003: Move LoadProgressTracker to the browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: recomment Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
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/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 #include "content/renderer/drop_data_builder.h" 79 #include "content/renderer/drop_data_builder.h"
80 #include "content/renderer/external_popup_menu.h" 80 #include "content/renderer/external_popup_menu.h"
81 #include "content/renderer/geolocation_dispatcher.h" 81 #include "content/renderer/geolocation_dispatcher.h"
82 #include "content/renderer/gpu/render_widget_compositor.h" 82 #include "content/renderer/gpu/render_widget_compositor.h"
83 #include "content/renderer/history_controller.h" 83 #include "content/renderer/history_controller.h"
84 #include "content/renderer/history_serialization.h" 84 #include "content/renderer/history_serialization.h"
85 #include "content/renderer/idle_user_detector.h" 85 #include "content/renderer/idle_user_detector.h"
86 #include "content/renderer/ime_event_guard.h" 86 #include "content/renderer/ime_event_guard.h"
87 #include "content/renderer/input/input_handler_manager.h" 87 #include "content/renderer/input/input_handler_manager.h"
88 #include "content/renderer/internal_document_state_data.h" 88 #include "content/renderer/internal_document_state_data.h"
89 #include "content/renderer/load_progress_tracker.h"
90 #include "content/renderer/media/audio_device_factory.h" 89 #include "content/renderer/media/audio_device_factory.h"
91 #include "content/renderer/media/media_stream_dispatcher.h" 90 #include "content/renderer/media/media_stream_dispatcher.h"
92 #include "content/renderer/media/midi_dispatcher.h" 91 #include "content/renderer/media/midi_dispatcher.h"
93 #include "content/renderer/media/video_capture_impl_manager.h" 92 #include "content/renderer/media/video_capture_impl_manager.h"
94 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" 93 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h"
95 #include "content/renderer/memory_benchmarking_extension.h" 94 #include "content/renderer/memory_benchmarking_extension.h"
96 #include "content/renderer/mhtml_generator.h" 95 #include "content/renderer/mhtml_generator.h"
97 #include "content/renderer/push_messaging_dispatcher.h" 96 #include "content/renderer/push_messaging_dispatcher.h"
98 #include "content/renderer/render_frame_impl.h" 97 #include "content/renderer/render_frame_impl.h"
99 #include "content/renderer/render_process.h" 98 #include "content/renderer/render_process.h"
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 #endif 664 #endif
666 #if defined(OS_WIN) 665 #if defined(OS_WIN)
667 focused_plugin_id_(-1), 666 focused_plugin_id_(-1),
668 #endif 667 #endif
669 #if defined(ENABLE_PLUGINS) 668 #if defined(ENABLE_PLUGINS)
670 plugin_find_handler_(NULL), 669 plugin_find_handler_(NULL),
671 focused_pepper_plugin_(NULL), 670 focused_pepper_plugin_(NULL),
672 pepper_last_mouse_event_target_(NULL), 671 pepper_last_mouse_event_target_(NULL),
673 #endif 672 #endif
674 enumeration_completion_id_(0), 673 enumeration_completion_id_(0),
675 load_progress_tracker_(new LoadProgressTracker(this)),
676 session_storage_namespace_id_(params->session_storage_namespace_id), 674 session_storage_namespace_id_(params->session_storage_namespace_id),
677 next_snapshot_id_(0) { 675 next_snapshot_id_(0) {
678 } 676 }
679 677
680 void RenderViewImpl::Initialize(RenderViewImplParams* params) { 678 void RenderViewImpl::Initialize(RenderViewImplParams* params) {
681 routing_id_ = params->routing_id; 679 routing_id_ = params->routing_id;
682 surface_id_ = params->surface_id; 680 surface_id_ = params->surface_id;
683 if (params->opener_id != MSG_ROUTING_NONE && params->is_renderer_created) 681 if (params->opener_id != MSG_ROUTING_NONE && params->is_renderer_created)
684 opener_id_ = params->opener_id; 682 opener_id_ = params->opener_id;
685 683
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
1519 WebFileChooserCompletion* chooser_completion) { 1517 WebFileChooserCompletion* chooser_completion) {
1520 int id = enumeration_completion_id_++; 1518 int id = enumeration_completion_id_++;
1521 enumeration_completions_[id] = chooser_completion; 1519 enumeration_completions_[id] = chooser_completion;
1522 return Send(new ViewHostMsg_EnumerateDirectory( 1520 return Send(new ViewHostMsg_EnumerateDirectory(
1523 routing_id_, 1521 routing_id_,
1524 id, 1522 id,
1525 base::FilePath::FromUTF16Unsafe(path))); 1523 base::FilePath::FromUTF16Unsafe(path)));
1526 } 1524 }
1527 1525
1528 void RenderViewImpl::FrameDidStartLoading(WebFrame* frame) { 1526 void RenderViewImpl::FrameDidStartLoading(WebFrame* frame) {
1529 if (load_progress_tracker_ != NULL) {
1530 load_progress_tracker_->DidStartLoading(
1531 RenderFrameImpl::FromWebFrame(frame)->GetRoutingID());
1532 }
1533 DCHECK_GE(frames_in_progress_, 0); 1527 DCHECK_GE(frames_in_progress_, 0);
1534 if (frames_in_progress_ == 0) 1528 if (frames_in_progress_ == 0)
1535 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidStartLoading()); 1529 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidStartLoading());
1536 frames_in_progress_++; 1530 frames_in_progress_++;
1537 } 1531 }
1538 1532
1539 void RenderViewImpl::FrameDidStopLoading(WebFrame* frame) { 1533 void RenderViewImpl::FrameDidStopLoading(WebFrame* frame) {
1540 if (load_progress_tracker_ != NULL) {
1541 load_progress_tracker_->DidStopLoading(
1542 RenderFrameImpl::FromWebFrame(frame)->GetRoutingID());
1543 }
1544 // TODO(japhet): This should be a DCHECK, but the pdf plugin sometimes 1534 // TODO(japhet): This should be a DCHECK, but the pdf plugin sometimes
1545 // calls DidStopLoading() without a matching DidStartLoading(). 1535 // calls DidStopLoading() without a matching DidStartLoading().
1546 if (frames_in_progress_ == 0) 1536 if (frames_in_progress_ == 0)
1547 return; 1537 return;
1548 frames_in_progress_--; 1538 frames_in_progress_--;
1549 if (frames_in_progress_ == 0) { 1539 if (frames_in_progress_ == 0) {
1550 DidStopLoadingIcons(); 1540 DidStopLoadingIcons();
1551 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidStopLoading()); 1541 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidStopLoading());
1552 } 1542 }
1553 } 1543 }
1554 1544
1555 void RenderViewImpl::FrameDidChangeLoadProgress(WebFrame* frame,
1556 double load_progress) {
1557 if (load_progress_tracker_ != NULL) {
1558 load_progress_tracker_->DidChangeLoadProgress(
1559 RenderFrameImpl::FromWebFrame(frame)->GetRoutingID(), load_progress);
1560 }
1561 }
1562
1563 void RenderViewImpl::didCancelCompositionOnSelectionChange() { 1545 void RenderViewImpl::didCancelCompositionOnSelectionChange() {
1564 Send(new ViewHostMsg_ImeCancelComposition(routing_id())); 1546 Send(new ViewHostMsg_ImeCancelComposition(routing_id()));
1565 } 1547 }
1566 1548
1567 void RenderViewImpl::didExecuteCommand(const WebString& command_name) { 1549 void RenderViewImpl::didExecuteCommand(const WebString& command_name) {
1568 const std::string& name = base::UTF16ToUTF8(command_name); 1550 const std::string& name = base::UTF16ToUTF8(command_name);
1569 if (StartsWithASCII(name, "Move", true) || 1551 if (StartsWithASCII(name, "Move", true) ||
1570 StartsWithASCII(name, "Insert", true) || 1552 StartsWithASCII(name, "Insert", true) ||
1571 StartsWithASCII(name, "Delete", true)) 1553 StartsWithASCII(name, "Delete", true))
1572 return; 1554 return;
(...skipping 2513 matching lines...) Expand 10 before | Expand all | Expand 10 after
4086 std::vector<gfx::Size> sizes; 4068 std::vector<gfx::Size> sizes;
4087 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4069 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4088 if (!url.isEmpty()) 4070 if (!url.isEmpty())
4089 urls.push_back( 4071 urls.push_back(
4090 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4072 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4091 } 4073 }
4092 SendUpdateFaviconURL(urls); 4074 SendUpdateFaviconURL(urls);
4093 } 4075 }
4094 4076
4095 } // namespace content 4077 } // namespace content
OLDNEW
« content/browser/web_contents/web_contents_impl.cc ('K') | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698