| OLD | NEW |
| 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 /* ***** BEGIN LICENSE BLOCK ***** | 2 /* ***** BEGIN LICENSE BLOCK ***** |
| 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 4 * | 4 * |
| 5 * The contents of this file are subject to the Mozilla Public License Version | 5 * The contents of this file are subject to the Mozilla Public License Version |
| 6 * 1.1 (the "License"); you may not use this file except in compliance with | 6 * 1.1 (the "License"); you may not use this file except in compliance with |
| 7 * the License. You may obtain a copy of the License at | 7 * the License. You may obtain a copy of the License at |
| 8 * http://www.mozilla.org/MPL/ | 8 * http://www.mozilla.org/MPL/ |
| 9 * | 9 * |
| 10 * Software distributed under the License is distributed on an "AS IS" basis, | 10 * Software distributed under the License is distributed on an "AS IS" basis, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 #include "chrome/browser/importer/mork_reader.h" | 43 #include "chrome/browser/importer/mork_reader.h" |
| 44 | 44 |
| 45 #include <algorithm> | 45 #include <algorithm> |
| 46 | 46 |
| 47 #include "base/logging.h" | 47 #include "base/logging.h" |
| 48 #include "base/string_util.h" | 48 #include "base/string_util.h" |
| 49 #include "chrome/browser/history/history_types.h" | 49 #include "chrome/browser/history/history_types.h" |
| 50 #include "chrome/browser/importer/firefox_importer_utils.h" | 50 #include "chrome/browser/importer/firefox_importer_utils.h" |
| 51 | 51 |
| 52 using base::Time; |
| 53 |
| 52 namespace { | 54 namespace { |
| 53 | 55 |
| 54 // Convert a hex character (0-9, A-F) to its corresponding byte value. | 56 // Convert a hex character (0-9, A-F) to its corresponding byte value. |
| 55 // Returns -1 if the character is invalid. | 57 // Returns -1 if the character is invalid. |
| 56 inline int HexCharToInt(char c) { | 58 inline int HexCharToInt(char c) { |
| 57 if ('0' <= c && c <= '9') | 59 if ('0' <= c && c <= '9') |
| 58 return c - '0'; | 60 return c - '0'; |
| 59 if ('A' <= c && c <= 'F') | 61 if ('A' <= c && c <= 'F') |
| 60 return c - 'A' + 10; | 62 return c - 'A' + 10; |
| 61 return -1; | 63 return -1; |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 } | 574 } |
| 573 } | 575 } |
| 574 | 576 |
| 575 std::vector<history::URLRow> rows; | 577 std::vector<history::URLRow> rows; |
| 576 for (MorkReader::iterator i = reader.begin(); i != reader.end(); ++i) | 578 for (MorkReader::iterator i = reader.begin(); i != reader.end(); ++i) |
| 577 AddToHistory(i->second, data, &rows); | 579 AddToHistory(i->second, data, &rows); |
| 578 if (!rows.empty()) | 580 if (!rows.empty()) |
| 579 loop->PostTask(FROM_HERE, NewRunnableMethod(writer, | 581 loop->PostTask(FROM_HERE, NewRunnableMethod(writer, |
| 580 &ProfileWriter::AddHistoryPage, rows)); | 582 &ProfileWriter::AddHistoryPage, rows)); |
| 581 } | 583 } |
| OLD | NEW |