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

Side by Side Diff: third_party/WebKit/Source/core/dom/ExecutionContext.cpp

Issue 2842253002: Move ReportLocalLoadFailed to ExecutionContext (Closed)
Patch Set: Created 3 years, 7 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2012 Google Inc. All Rights Reserved. 3 * Copyright (C) 2012 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 if (ShouldSanitizeScriptError(error_event->filename(), cors_status)) 138 if (ShouldSanitizeScriptError(error_event->filename(), cors_status))
139 error_event = ErrorEvent::CreateSanitizedError(error_event->World()); 139 error_event = ErrorEvent::CreateSanitizedError(error_event->World());
140 140
141 DCHECK(!in_dispatch_error_event_); 141 DCHECK(!in_dispatch_error_event_);
142 in_dispatch_error_event_ = true; 142 in_dispatch_error_event_ = true;
143 target->DispatchEvent(error_event); 143 target->DispatchEvent(error_event);
144 in_dispatch_error_event_ = false; 144 in_dispatch_error_event_ = false;
145 return error_event->defaultPrevented(); 145 return error_event->defaultPrevented();
146 } 146 }
147 147
148 void ExecutionContext::ReportLocalLoadFailed(const String& url) {
149 DCHECK(!url.IsEmpty());
150 AddConsoleMessage(
kinuko 2017/05/17 06:10:23 I think we can just call ExecutionContext::AddCons
151 ConsoleMessage::Create(kSecurityMessageSource, kErrorMessageLevel,
152 "Not allowed to load local resource: " + url));
153 }
154
148 int ExecutionContext::CircularSequentialID() { 155 int ExecutionContext::CircularSequentialID() {
149 ++circular_sequential_id_; 156 ++circular_sequential_id_;
150 if (circular_sequential_id_ > ((1U << 31) - 1U)) 157 if (circular_sequential_id_ > ((1U << 31) - 1U))
151 circular_sequential_id_ = 1; 158 circular_sequential_id_ = 1;
152 159
153 return circular_sequential_id_; 160 return circular_sequential_id_;
154 } 161 }
155 162
156 PublicURLManager& ExecutionContext::GetPublicURLManager() { 163 PublicURLManager& ExecutionContext::GetPublicURLManager() {
157 if (!public_url_manager_) 164 if (!public_url_manager_)
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 } 246 }
240 247
241 DEFINE_TRACE(ExecutionContext) { 248 DEFINE_TRACE(ExecutionContext) {
242 visitor->Trace(public_url_manager_); 249 visitor->Trace(public_url_manager_);
243 visitor->Trace(pending_exceptions_); 250 visitor->Trace(pending_exceptions_);
244 ContextLifecycleNotifier::Trace(visitor); 251 ContextLifecycleNotifier::Trace(visitor);
245 Supplementable<ExecutionContext>::Trace(visitor); 252 Supplementable<ExecutionContext>::Trace(visitor);
246 } 253 }
247 254
248 } // namespace blink 255 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ExecutionContext.h ('k') | third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698