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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 10535026: Move creation and ownership of DownloadManager from the embedder to content. This matches all the o… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix cros compile Created 8 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 | 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/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/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // - Once the onunload handler is finished, a SwapOut_ACK message is sent to 115 // - Once the onunload handler is finished, a SwapOut_ACK message is sent to
116 // the ResourceDispatcherHost, who unpauses the response. Data is then sent 116 // the ResourceDispatcherHost, who unpauses the response. Data is then sent
117 // to the pending RVH. 117 // to the pending RVH.
118 // - The pending renderer sends a FrameNavigate message that invokes the 118 // - The pending renderer sends a FrameNavigate message that invokes the
119 // DidNavigate method. This replaces the current RVH with the 119 // DidNavigate method. This replaces the current RVH with the
120 // pending RVH. 120 // pending RVH.
121 // - The previous renderer is kept swapped out in RenderViewHostManager in case 121 // - The previous renderer is kept swapped out in RenderViewHostManager in case
122 // the user goes back. The process only stays live if another tab is using 122 // the user goes back. The process only stays live if another tab is using
123 // it, but if so, the existing frame relationships will be maintained. 123 // it, but if so, the existing frame relationships will be maintained.
124 124
125 using content::BrowserContext;
125 using content::DevToolsAgentHost; 126 using content::DevToolsAgentHost;
126 using content::DevToolsAgentHostRegistry; 127 using content::DevToolsAgentHostRegistry;
127 using content::DevToolsManagerImpl; 128 using content::DevToolsManagerImpl;
128 using content::DownloadItem; 129 using content::DownloadItem;
129 using content::DownloadManager; 130 using content::DownloadManager;
130 using content::DownloadUrlParameters; 131 using content::DownloadUrlParameters;
131 using content::GlobalRequestID; 132 using content::GlobalRequestID;
132 using content::HostZoomMap; 133 using content::HostZoomMap;
133 using content::InterstitialPage; 134 using content::InterstitialPage;
134 using content::LoadNotificationDetails; 135 using content::LoadNotificationDetails;
(...skipping 2901 matching lines...) Expand 10 before | Expand all | Expand 10 after
3036 } 3037 }
3037 3038
3038 void WebContentsImpl::SetEncoding(const std::string& encoding) { 3039 void WebContentsImpl::SetEncoding(const std::string& encoding) {
3039 encoding_ = content::GetContentClient()->browser()-> 3040 encoding_ = content::GetContentClient()->browser()->
3040 GetCanonicalEncodingNameByAliasName(encoding); 3041 GetCanonicalEncodingNameByAliasName(encoding);
3041 } 3042 }
3042 3043
3043 void WebContentsImpl::SaveURL(const GURL& url, 3044 void WebContentsImpl::SaveURL(const GURL& url,
3044 const content::Referrer& referrer, 3045 const content::Referrer& referrer,
3045 bool is_main_frame) { 3046 bool is_main_frame) {
3046 DownloadManager* dlm = GetBrowserContext()->GetDownloadManager(); 3047 DownloadManager* dlm =
3048 BrowserContext::GetDownloadManager(GetBrowserContext());
3047 if (!dlm) 3049 if (!dlm)
3048 return; 3050 return;
3049 int64 post_id = -1; 3051 int64 post_id = -1;
3050 if (is_main_frame) { 3052 if (is_main_frame) {
3051 const NavigationEntry* entry = controller_.GetActiveEntry(); 3053 const NavigationEntry* entry = controller_.GetActiveEntry();
3052 if (entry) 3054 if (entry)
3053 post_id = entry->GetPostID(); 3055 post_id = entry->GetPostID();
3054 } 3056 }
3055 content::DownloadSaveInfo save_info; 3057 content::DownloadSaveInfo save_info;
3056 save_info.prompt_for_save_location = true; 3058 save_info.prompt_for_save_location = true;
(...skipping 26 matching lines...) Expand all
3083 browser_plugin_host()->embedder_render_process_host(); 3085 browser_plugin_host()->embedder_render_process_host();
3084 *embedder_container_id = browser_plugin_host()->instance_id(); 3086 *embedder_container_id = browser_plugin_host()->instance_id();
3085 int embedder_process_id = 3087 int embedder_process_id =
3086 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; 3088 embedder_render_process_host ? embedder_render_process_host->GetID() : -1;
3087 if (embedder_process_id != -1) { 3089 if (embedder_process_id != -1) {
3088 *embedder_channel_name = 3090 *embedder_channel_name =
3089 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), 3091 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(),
3090 embedder_process_id); 3092 embedder_process_id);
3091 } 3093 }
3092 } 3094 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698