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

Side by Side Diff: third_party/WebKit/Source/core/fetch/FetchRequest.cpp

Issue 2327643003: Replace ASSERT*() with DCHECK*() in core/fetch/ and core/loader/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 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 /* 1 /*
2 * Copyright (C) 2012 Google, Inc. All rights reserved. 2 * Copyright (C) 2012 Google, Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 { 66 {
67 m_options.initiatorInfo = initiator; 67 m_options.initiatorInfo = initiator;
68 } 68 }
69 69
70 FetchRequest::~FetchRequest() 70 FetchRequest::~FetchRequest()
71 { 71 {
72 } 72 }
73 73
74 void FetchRequest::setCrossOriginAccessControl(SecurityOrigin* origin, CrossOrig inAttributeValue crossOrigin) 74 void FetchRequest::setCrossOriginAccessControl(SecurityOrigin* origin, CrossOrig inAttributeValue crossOrigin)
75 { 75 {
76 ASSERT(crossOrigin != CrossOriginAttributeNotSet); 76 DCHECK_NE(crossOrigin, CrossOriginAttributeNotSet);
77 const bool useCredentials = crossOrigin == CrossOriginAttributeUseCredential s; 77 const bool useCredentials = crossOrigin == CrossOriginAttributeUseCredential s;
78 const bool isSameOriginRequest = origin && origin->canRequestNoSuborigin(m_r esourceRequest.url()); 78 const bool isSameOriginRequest = origin && origin->canRequestNoSuborigin(m_r esourceRequest.url());
79 79
80 // Currently FetchRequestMode and FetchCredentialsMode are only used when th e request goes to Service Worker. 80 // Currently FetchRequestMode and FetchCredentialsMode are only used when th e request goes to Service Worker.
81 m_resourceRequest.setFetchRequestMode(WebURLRequest::FetchRequestModeCORS); 81 m_resourceRequest.setFetchRequestMode(WebURLRequest::FetchRequestModeCORS);
82 m_resourceRequest.setFetchCredentialsMode(useCredentials ? WebURLRequest::Fe tchCredentialsModeInclude : WebURLRequest::FetchCredentialsModeSameOrigin); 82 m_resourceRequest.setFetchCredentialsMode(useCredentials ? WebURLRequest::Fe tchCredentialsModeInclude : WebURLRequest::FetchCredentialsModeSameOrigin);
83 83
84 m_options.allowCredentials = (isSameOriginRequest || useCredentials) ? Allow StoredCredentials : DoNotAllowStoredCredentials; 84 m_options.allowCredentials = (isSameOriginRequest || useCredentials) ? Allow StoredCredentials : DoNotAllowStoredCredentials;
85 m_options.corsEnabled = IsCORSEnabled; 85 m_options.corsEnabled = IsCORSEnabled;
86 m_options.securityOrigin = origin; 86 m_options.securityOrigin = origin;
(...skipping 19 matching lines...) Expand all
106 106
107 void FetchRequest::makeSynchronous() 107 void FetchRequest::makeSynchronous()
108 { 108 {
109 // Synchronous requests should always be max priority, lest they hang the re nderer. 109 // Synchronous requests should always be max priority, lest they hang the re nderer.
110 m_resourceRequest.setPriority(ResourceLoadPriorityHighest); 110 m_resourceRequest.setPriority(ResourceLoadPriorityHighest);
111 m_resourceRequest.setTimeoutInterval(10); 111 m_resourceRequest.setTimeoutInterval(10);
112 m_options.synchronousPolicy = RequestSynchronously; 112 m_options.synchronousPolicy = RequestSynchronously;
113 } 113 }
114 114
115 } // namespace blink 115 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/DocumentResource.cpp ('k') | third_party/WebKit/Source/core/fetch/FontResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698