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

Side by Side Diff: content/child/resource_dispatcher.cc

Issue 2816403002: test all
Patch Set: fix sharedworker Created 3 years, 8 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
6 6
7 #include "content/child/resource_dispatcher.h" 7 #include "content/child/resource_dispatcher.h"
8 8
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/atomic_sequence_num.h"
11 #include "base/bind.h" 12 #include "base/bind.h"
12 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
13 #include "base/debug/alias.h" 14 #include "base/debug/alias.h"
14 #include "base/debug/dump_without_crashing.h" 15 #include "base/debug/dump_without_crashing.h"
15 #include "base/debug/stack_trace.h" 16 #include "base/debug/stack_trace.h"
16 #include "base/files/file_path.h" 17 #include "base/files/file_path.h"
17 #include "base/memory/ptr_util.h" 18 #include "base/memory/ptr_util.h"
18 #include "base/memory/shared_memory.h" 19 #include "base/memory/shared_memory.h"
19 #include "base/message_loop/message_loop.h" 20 #include "base/message_loop/message_loop.h"
20 #include "base/metrics/histogram_macros.h" 21 #include "base/metrics/histogram_macros.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 base::debug::Alias(&last_err); 61 base::debug::Alias(&last_err);
61 #endif 62 #endif
62 CHECK(false); 63 CHECK(false);
63 } 64 }
64 65
65 // Each resource request is assigned an ID scoped to this process. 66 // Each resource request is assigned an ID scoped to this process.
66 int MakeRequestID() { 67 int MakeRequestID() {
67 // NOTE: The resource_dispatcher_host also needs probably unique 68 // NOTE: The resource_dispatcher_host also needs probably unique
68 // request_ids, so they count down from -2 (-1 is a special we're 69 // request_ids, so they count down from -2 (-1 is a special we're
69 // screwed value), while the renderer process counts up. 70 // screwed value), while the renderer process counts up.
70 static int next_request_id = 0; 71 static base::StaticAtomicSequenceNumber sequence;
71 return next_request_id++; 72 return sequence.GetNext(); // We start at zero.
72 } 73 }
73 74
74 void CheckSchemeForReferrerPolicy(const ResourceRequest& request) { 75 void CheckSchemeForReferrerPolicy(const ResourceRequest& request) {
75 if ((request.referrer_policy == blink::kWebReferrerPolicyDefault || 76 if ((request.referrer_policy == blink::kWebReferrerPolicyDefault ||
76 request.referrer_policy == 77 request.referrer_policy ==
77 blink::kWebReferrerPolicyNoReferrerWhenDowngrade) && 78 blink::kWebReferrerPolicyNoReferrerWhenDowngrade) &&
78 request.referrer.SchemeIsCryptographic() && 79 request.referrer.SchemeIsCryptographic() &&
79 !request.url.SchemeIsCryptographic()) { 80 !request.url.SchemeIsCryptographic()) {
80 LOG(FATAL) << "Trying to send secure referrer for insecure request " 81 LOG(FATAL) << "Trying to send secure referrer for insecure request "
81 << "without an appropriate referrer policy.\n" 82 << "without an appropriate referrer policy.\n"
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 delete message; 838 delete message;
838 } 839 }
839 } 840 }
840 841
841 void ResourceDispatcher::SetResourceSchedulingFilter( 842 void ResourceDispatcher::SetResourceSchedulingFilter(
842 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) { 843 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) {
843 resource_scheduling_filter_ = resource_scheduling_filter; 844 resource_scheduling_filter_ = resource_scheduling_filter;
844 } 845 }
845 846
846 } // namespace content 847 } // namespace content
OLDNEW
« no previous file with comments | « content/child/appcache/web_application_cache_host_impl.cc ('k') | content/child/runtime_features.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698