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

Side by Side Diff: Source/core/loader/TextTrackLoader.cpp

Issue 419203004: DevTools: wrapping arguments addConsoleMessage in ConsoleMessage (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@wrap-not-all-console-args
Patch Set: Created 6 years, 4 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
« no previous file with comments | « Source/core/loader/MixedContentChecker.cpp ('k') | Source/core/page/CreateWindow.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 14 matching lines...) Expand all
25 25
26 #include "config.h" 26 #include "config.h"
27 27
28 #include "core/loader/TextTrackLoader.h" 28 #include "core/loader/TextTrackLoader.h"
29 29
30 #include "core/FetchInitiatorTypeNames.h" 30 #include "core/FetchInitiatorTypeNames.h"
31 #include "core/dom/Document.h" 31 #include "core/dom/Document.h"
32 #include "core/fetch/CrossOriginAccessControl.h" 32 #include "core/fetch/CrossOriginAccessControl.h"
33 #include "core/fetch/FetchRequest.h" 33 #include "core/fetch/FetchRequest.h"
34 #include "core/fetch/ResourceFetcher.h" 34 #include "core/fetch/ResourceFetcher.h"
35 #include "core/inspector/ConsoleMessage.h"
35 #include "platform/Logging.h" 36 #include "platform/Logging.h"
36 #include "platform/SharedBuffer.h" 37 #include "platform/SharedBuffer.h"
37 #include "platform/weborigin/SecurityOrigin.h" 38 #include "platform/weborigin/SecurityOrigin.h"
38 39
39 namespace blink { 40 namespace blink {
40 41
41 TextTrackLoader::TextTrackLoader(TextTrackLoaderClient& client, Document& docume nt) 42 TextTrackLoader::TextTrackLoader(TextTrackLoaderClient& client, Document& docume nt)
42 : m_client(client) 43 : m_client(client)
43 , m_document(document) 44 , m_document(document)
44 , m_cueLoadTimer(this, &TextTrackLoader::cueLoadTimerFired) 45 , m_cueLoadTimer(this, &TextTrackLoader::cueLoadTimerFired)
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 79
79 if (!m_cueParser) 80 if (!m_cueParser)
80 m_cueParser = VTTParser::create(this, document()); 81 m_cueParser = VTTParser::create(this, document());
81 82
82 m_cueParser->parseBytes(data, length); 83 m_cueParser->parseBytes(data, length);
83 } 84 }
84 85
85 void TextTrackLoader::corsPolicyPreventedLoad(SecurityOrigin* securityOrigin, co nst KURL& url) 86 void TextTrackLoader::corsPolicyPreventedLoad(SecurityOrigin* securityOrigin, co nst KURL& url)
86 { 87 {
87 String consoleMessage("Text track from origin '" + SecurityOrigin::create(ur l)->toString() + "' has been blocked from loading: Not at same origin as the doc ument, and parent of track element does not have a 'crossorigin' attribute. Orig in '" + securityOrigin->toString() + "' is therefore not allowed access."); 88 String consoleMessage("Text track from origin '" + SecurityOrigin::create(ur l)->toString() + "' has been blocked from loading: Not at same origin as the doc ument, and parent of track element does not have a 'crossorigin' attribute. Orig in '" + securityOrigin->toString() + "' is therefore not allowed access.");
88 document().addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, conso leMessage); 89 document().addConsoleMessage(ConsoleMessage::create(SecurityMessageSource, E rrorMessageLevel, consoleMessage));
89 m_state = Failed; 90 m_state = Failed;
90 } 91 }
91 92
92 void TextTrackLoader::notifyFinished(Resource* resource) 93 void TextTrackLoader::notifyFinished(Resource* resource)
93 { 94 {
94 ASSERT(this->resource() == resource); 95 ASSERT(this->resource() == resource);
95 if (m_state != Failed) 96 if (m_state != Failed)
96 m_state = resource->errorOccurred() ? Failed : Finished; 97 m_state = resource->errorOccurred() ? Failed : Finished;
97 98
98 if (m_state == Finished && m_cueParser) 99 if (m_state == Finished && m_cueParser)
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 m_cueParser->getNewRegions(outputRegions); 164 m_cueParser->getNewRegions(outputRegions);
164 } 165 }
165 166
166 void TextTrackLoader::trace(Visitor* visitor) 167 void TextTrackLoader::trace(Visitor* visitor)
167 { 168 {
168 visitor->trace(m_cueParser); 169 visitor->trace(m_cueParser);
169 visitor->trace(m_document); 170 visitor->trace(m_document);
170 } 171 }
171 172
172 } 173 }
OLDNEW
« no previous file with comments | « Source/core/loader/MixedContentChecker.cpp ('k') | Source/core/page/CreateWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698