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

Side by Side Diff: extensions/browser/extension_error.cc

Issue 23717041: Fix deadcode in an invalid string construction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "extensions/browser/extension_error.h" 5 #include "extensions/browser/extension_error.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "extensions/common/constants.h" 10 #include "extensions/common/constants.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 message_(message), 50 message_(message),
51 occurrences_(1u) { 51 occurrences_(1u) {
52 } 52 }
53 53
54 ExtensionError::~ExtensionError() { 54 ExtensionError::~ExtensionError() {
55 } 55 }
56 56
57 std::string ExtensionError::PrintForTest() const { 57 std::string ExtensionError::PrintForTest() const {
58 return std::string("Extension Error:") + 58 return std::string("Extension Error:") +
59 "\n OTR: " + std::string(from_incognito_ ? "true" : "false") + 59 "\n OTR: " + std::string(from_incognito_ ? "true" : "false") +
60 "\n Level: " + base::IntToString(static_cast<int>(level_)); 60 "\n Level: " + base::IntToString(static_cast<int>(level_)) +
61 "\n Source: " + base::UTF16ToUTF8(source_) + 61 "\n Source: " + base::UTF16ToUTF8(source_) +
62 "\n Message: " + base::UTF16ToUTF8(message_) + 62 "\n Message: " + base::UTF16ToUTF8(message_) +
63 "\n ID: " + extension_id_; 63 "\n ID: " + extension_id_;
64 } 64 }
65 65
66 bool ExtensionError::IsEqual(const ExtensionError* rhs) const { 66 bool ExtensionError::IsEqual(const ExtensionError* rhs) const {
67 // We don't check |source_| or |level_| here, since they are constant for 67 // We don't check |source_| or |level_| here, since they are constant for
68 // manifest errors. Check them in RuntimeError::IsEqualImpl() instead. 68 // manifest errors. Check them in RuntimeError::IsEqualImpl() instead.
69 return type_ == rhs->type_ && 69 return type_ == rhs->type_ &&
70 extension_id_ == rhs->extension_id_ && 70 extension_id_ == rhs->extension_id_ &&
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // other systems), the source won't match up with the final entry in the stack 165 // other systems), the source won't match up with the final entry in the stack
166 // trace. (For instance, in a browser action error, the source is the page - 166 // trace. (For instance, in a browser action error, the source is the page -
167 // sometimes the background page - but the error is thrown from the script.) 167 // sometimes the background page - but the error is thrown from the script.)
168 // Make the source match the stack trace, since that is more likely the cause 168 // Make the source match the stack trace, since that is more likely the cause
169 // of the error. 169 // of the error.
170 if (!stack_trace_.empty() && source_ != stack_trace_[0].source) 170 if (!stack_trace_.empty() && source_ != stack_trace_[0].source)
171 source_ = stack_trace_[0].source; 171 source_ = stack_trace_[0].source;
172 } 172 }
173 173
174 } // namespace extensions 174 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698