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

Side by Side Diff: chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc

Issue 6328010: Fix Task Manager to correctly display network usage of plug-in processes. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Set origin PID consistently, and only set it for plugin requests. Created 9 years, 10 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <vector> 5 #include <vector>
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "chrome/browser/browser_thread.h" 10 #include "chrome/browser/browser_thread.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 ResourceType::Type type, 66 ResourceType::Type type,
67 const GURL& url) { 67 const GURL& url) {
68 ViewHostMsg_Resource_Request request; 68 ViewHostMsg_Resource_Request request;
69 request.method = std::string(method); 69 request.method = std::string(method);
70 request.url = url; 70 request.url = url;
71 request.first_party_for_cookies = url; // bypass third-party cookie blocking 71 request.first_party_for_cookies = url; // bypass third-party cookie blocking
72 // init the rest to default values to prevent getting UMR. 72 // init the rest to default values to prevent getting UMR.
73 request.frame_origin = "null"; 73 request.frame_origin = "null";
74 request.main_frame_origin = "null"; 74 request.main_frame_origin = "null";
75 request.load_flags = 0; 75 request.load_flags = 0;
76 request.origin_child_id = 0; 76 request.origin_pid = 0;
77 request.resource_type = type; 77 request.resource_type = type;
78 request.request_context = 0; 78 request.request_context = 0;
79 request.appcache_host_id = appcache::kNoHostId; 79 request.appcache_host_id = appcache::kNoHostId;
80 request.download_to_file = false; 80 request.download_to_file = false;
81 request.host_renderer_id = -1; 81 request.host_renderer_id = -1;
82 request.host_render_view_id = -1; 82 request.host_render_view_id = -1;
83 return request; 83 return request;
84 } 84 }
85 85
86 // Spin up the message loop to kick off the request. 86 // Spin up the message loop to kick off the request.
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 EXPECT_TRUE(request_info_->replace_extension_localization_templates()); 1021 EXPECT_TRUE(request_info_->replace_extension_localization_templates());
1022 } 1022 }
1023 1023
1024 TEST_F(ApplyExtensionLocalizationFilterTest, GoodSchemeWrongResourceType) { 1024 TEST_F(ApplyExtensionLocalizationFilterTest, GoodSchemeWrongResourceType) {
1025 resource_type_ = ResourceType::MAIN_FRAME; 1025 resource_type_ = ResourceType::MAIN_FRAME;
1026 ResourceDispatcherHost::ApplyExtensionLocalizationFilter(*url_, 1026 ResourceDispatcherHost::ApplyExtensionLocalizationFilter(*url_,
1027 resource_type_, request_info_.get()); 1027 resource_type_, request_info_.get());
1028 1028
1029 EXPECT_FALSE(request_info_->replace_extension_localization_templates()); 1029 EXPECT_FALSE(request_info_->replace_extension_localization_templates());
1030 } 1030 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698