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

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

Issue 2860593003: Refactoring DownloadManager::DownloadURL to add proper annotation. (Closed)
Patch Set: Comment addressed. Created 3 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
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 #include "content/public/common/content_constants.h" 120 #include "content/public/common/content_constants.h"
121 #include "content/public/common/content_switches.h" 121 #include "content/public/common/content_switches.h"
122 #include "content/public/common/page_zoom.h" 122 #include "content/public/common/page_zoom.h"
123 #include "content/public/common/result_codes.h" 123 #include "content/public/common/result_codes.h"
124 #include "content/public/common/url_utils.h" 124 #include "content/public/common/url_utils.h"
125 #include "content/public/common/web_preferences.h" 125 #include "content/public/common/web_preferences.h"
126 #include "device/geolocation/geolocation_service_context.h" 126 #include "device/geolocation/geolocation_service_context.h"
127 #include "net/base/url_util.h" 127 #include "net/base/url_util.h"
128 #include "net/http/http_cache.h" 128 #include "net/http/http_cache.h"
129 #include "net/http/http_transaction_factory.h" 129 #include "net/http/http_transaction_factory.h"
130 #include "net/traffic_annotation/network_traffic_annotation.h"
130 #include "net/url_request/url_request_context.h" 131 #include "net/url_request/url_request_context.h"
131 #include "net/url_request/url_request_context_getter.h" 132 #include "net/url_request/url_request_context_getter.h"
132 #include "ppapi/features/features.h" 133 #include "ppapi/features/features.h"
133 #include "services/service_manager/public/cpp/interface_provider.h" 134 #include "services/service_manager/public/cpp/interface_provider.h"
134 #include "third_party/WebKit/public/platform/WebSecurityStyle.h" 135 #include "third_party/WebKit/public/platform/WebSecurityStyle.h"
135 #include "third_party/WebKit/public/web/WebSandboxFlags.h" 136 #include "third_party/WebKit/public/web/WebSandboxFlags.h"
136 #include "third_party/skia/include/core/SkBitmap.h" 137 #include "third_party/skia/include/core/SkBitmap.h"
137 #include "ui/accessibility/ax_tree_combiner.h" 138 #include "ui/accessibility/ax_tree_combiner.h"
138 #include "ui/base/layout.h" 139 #include "ui/base/layout.h"
139 #include "ui/events/blink/web_input_event_traits.h" 140 #include "ui/events/blink/web_input_event_traits.h"
(...skipping 3062 matching lines...) Expand 10 before | Expand all | Expand 10 after
3202 for (const base::StringPiece& key_value : 3203 for (const base::StringPiece& key_value :
3203 base::SplitStringPiece( 3204 base::SplitStringPiece(
3204 headers, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { 3205 headers, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
3205 std::vector<std::string> pair = base::SplitString( 3206 std::vector<std::string> pair = base::SplitString(
3206 key_value, ":", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 3207 key_value, ":", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
3207 DCHECK_EQ(2ul, pair.size()); 3208 DCHECK_EQ(2ul, pair.size());
3208 params->add_request_header(pair[0], pair[1]); 3209 params->add_request_header(pair[0], pair[1]);
3209 } 3210 }
3210 } 3211 }
3211 BrowserContext::GetDownloadManager(GetBrowserContext()) 3212 BrowserContext::GetDownloadManager(GetBrowserContext())
3212 ->DownloadUrl(std::move(params)); 3213 ->DownloadUrl(std::move(params), NO_TRAFFIC_ANNOTATION_YET);
3213 } 3214 }
3214 3215
3215 void WebContentsImpl::GenerateMHTML( 3216 void WebContentsImpl::GenerateMHTML(
3216 const MHTMLGenerationParams& params, 3217 const MHTMLGenerationParams& params,
3217 const base::Callback<void(int64_t)>& callback) { 3218 const base::Callback<void(int64_t)>& callback) {
3218 MHTMLGenerationManager::GetInstance()->SaveMHTML(this, params, callback); 3219 MHTMLGenerationManager::GetInstance()->SaveMHTML(this, params, callback);
3219 } 3220 }
3220 3221
3221 const std::string& WebContentsImpl::GetContentsMimeType() const { 3222 const std::string& WebContentsImpl::GetContentsMimeType() const {
3222 return contents_mime_type_; 3223 return contents_mime_type_;
(...skipping 2430 matching lines...) Expand 10 before | Expand all | Expand 10 after
5653 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); 5654 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host);
5654 if (!render_view_host) 5655 if (!render_view_host)
5655 continue; 5656 continue;
5656 render_view_host_set.insert(render_view_host); 5657 render_view_host_set.insert(render_view_host);
5657 } 5658 }
5658 for (RenderViewHost* render_view_host : render_view_host_set) 5659 for (RenderViewHost* render_view_host : render_view_host_set)
5659 render_view_host->OnWebkitPreferencesChanged(); 5660 render_view_host->OnWebkitPreferencesChanged();
5660 } 5661 }
5661 5662
5662 } // namespace content 5663 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_internals_ui.cc ('k') | content/public/browser/download_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698