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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameConsole.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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) 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2013 Apple 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 * 7 *
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 20 matching lines...) Expand all
31 #include "bindings/core/v8/SourceLocation.h" 31 #include "bindings/core/v8/SourceLocation.h"
32 #include "core/frame/FrameHost.h" 32 #include "core/frame/FrameHost.h"
33 #include "core/inspector/ConsoleMessage.h" 33 #include "core/inspector/ConsoleMessage.h"
34 #include "core/inspector/ConsoleMessageStorage.h" 34 #include "core/inspector/ConsoleMessageStorage.h"
35 #include "core/inspector/InspectorConsoleInstrumentation.h" 35 #include "core/inspector/InspectorConsoleInstrumentation.h"
36 #include "core/page/ChromeClient.h" 36 #include "core/page/ChromeClient.h"
37 #include "core/page/Page.h" 37 #include "core/page/Page.h"
38 #include "platform/network/ResourceError.h" 38 #include "platform/network/ResourceError.h"
39 #include "platform/network/ResourceResponse.h" 39 #include "platform/network/ResourceResponse.h"
40 #include "wtf/text/StringBuilder.h" 40 #include "wtf/text/StringBuilder.h"
41 #include <memory>
42 41
43 namespace blink { 42 namespace blink {
44 43
45 namespace { 44 namespace {
46 45
47 int muteCount = 0; 46 int muteCount = 0;
48 47
49 } 48 }
50 49
51 FrameConsole::FrameConsole(LocalFrame& frame) 50 FrameConsole::FrameConsole(LocalFrame& frame)
(...skipping 23 matching lines...) Expand all
75 return; 74 return;
76 if (consoleMessage->source() == NetworkMessageSource) 75 if (consoleMessage->source() == NetworkMessageSource)
77 return; 76 return;
78 77
79 String url = consoleMessage->location()->url(); 78 String url = consoleMessage->location()->url();
80 String stackTrace; 79 String stackTrace;
81 if (consoleMessage->source() == ConsoleAPIMessageSource) { 80 if (consoleMessage->source() == ConsoleAPIMessageSource) {
82 if (!frame().host()) 81 if (!frame().host())
83 return; 82 return;
84 if (frame().chromeClient().shouldReportDetailedMessageForSource(frame(), url)) { 83 if (frame().chromeClient().shouldReportDetailedMessageForSource(frame(), url)) {
85 std::unique_ptr<SourceLocation> location = SourceLocation::captureWi thFullStackTrace(); 84 OwnPtr<SourceLocation> location = SourceLocation::captureWithFullSta ckTrace();
86 if (!location->isUnknown()) 85 if (!location->isUnknown())
87 stackTrace = location->toString(); 86 stackTrace = location->toString();
88 } 87 }
89 } else { 88 } else {
90 if (!consoleMessage->location()->isUnknown() && frame().chromeClient().s houldReportDetailedMessageForSource(frame(), url)) 89 if (!consoleMessage->location()->isUnknown() && frame().chromeClient().s houldReportDetailedMessageForSource(frame(), url))
91 stackTrace = consoleMessage->location()->toString(); 90 stackTrace = consoleMessage->location()->toString();
92 } 91 }
93 92
94 frame().chromeClient().addMessageToConsole(m_frame, consoleMessage->source() , consoleMessage->level(), consoleMessage->message(), consoleMessage->location() ->lineNumber(), url, stackTrace); 93 frame().chromeClient().addMessageToConsole(m_frame, consoleMessage->source() , consoleMessage->level(), consoleMessage->message(), consoleMessage->location() ->lineNumber(), url, stackTrace);
95 } 94 }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 ConsoleMessage* consoleMessage = ConsoleMessage::createForRequest(NetworkMes sageSource, ErrorMessageLevel, message.toString(), error.failingURL(), requestId entifier); 157 ConsoleMessage* consoleMessage = ConsoleMessage::createForRequest(NetworkMes sageSource, ErrorMessageLevel, message.toString(), error.failingURL(), requestId entifier);
159 storage->reportMessage(m_frame->document(), consoleMessage); 158 storage->reportMessage(m_frame->document(), consoleMessage);
160 } 159 }
161 160
162 DEFINE_TRACE(FrameConsole) 161 DEFINE_TRACE(FrameConsole)
163 { 162 {
164 visitor->trace(m_frame); 163 visitor->trace(m_frame);
165 } 164 }
166 165
167 } // namespace blink 166 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameConsole.h ('k') | third_party/WebKit/Source/core/frame/FrameHost.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698