Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: src/plugin/PluginDebug.cpp

Issue 29323611: Issue #1234, #2058 - Rewrite log facility, improving thread implementation
Left Patch Set: rebase only Created Nov. 26, 2015, 1:07 p.m.
Right Patch Set: rebase only Created July 27, 2016, 9:11 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/plugin/PluginDebug.h ('k') | src/plugin/PluginMimeFilterClient.cpp » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 463
464 void Trace::ErrorCode(DWORD errorCode, const std::string& description, Trace::Lo cation location) 464 void Trace::ErrorCode(DWORD errorCode, const std::string& description, Trace::Lo cation location)
465 { 465 {
466 LogQueue::Insert(LogEntry(new LogTextErrorCode(errorCode, description), locati on)); 466 LogQueue::Insert(LogEntry(new LogTextErrorCode(errorCode, description), locati on));
467 } 467 }
468 468
469 void Trace::TextFixed(const std::string& description, Trace::Location location) 469 void Trace::TextFixed(const std::string& description, Trace::Location location)
470 { 470 {
471 LogQueue::Insert(LogEntry(new LogTextFixed(description), location)); 471 LogQueue::Insert(LogEntry(new LogTextFixed(description), location));
472 } 472 }
473
474 namespace
475 {
476 /*
477 * To convert a pointer to a hexadecimal number, we need an integral type that has the same size as that of the pointer.
478 */
479 #if defined(_WIN64)
480 typedef uint64_t voidIntegral;
481 static_assert(sizeof(void*)==sizeof(voidIntegral),"WIN64: sizeof(uint64_t) is not the same as sizeof(void*)");
482 #elif defined(_WIN32)
483 typedef uint32_t voidIntegral;
484 static_assert(sizeof(void*)==sizeof(voidIntegral),"WIN32: sizeof(uint32_t) is not the same as sizeof(void*)");
485 #else
486 #error Must compile with either _WIN32 or _WIN64
487 #endif
488 }
489
490 std::wstring ToHexLiteral(void const* p)
491 {
492 std::wstringstream ss;
493 ss << L"0x";
494 ss.width(sizeof(p) * 2);
495 ss.fill(L'0');
496 ss << std::hex << reinterpret_cast<voidIntegral>(p);
497 return ss.str();
498 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld